public abstract static class SolaceIO.Read<T>
extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>
PTransform to read from a Solace broker.| Constructor and Description |
|---|
Read() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.beam.sdk.values.PCollection<T> |
expand(org.apache.beam.sdk.values.PBegin input) |
void |
populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder) |
SolaceIO.Read<T> |
withAdvanceTimeoutInMillis(int advanceTimeoutInMillis)
Sets the message polling timeout for this
SolaceIO.Read. |
SolaceIO.Read<T> |
withCoder(org.apache.beam.sdk.coders.Coder<T> coder)
Sets the
Coder that this SolaceIO.Read will use to encode and decode the elements of the resulting
PCollection. |
SolaceIO.Read<T> |
withInboundMessageMapper(SolaceIO.InboundMessageMapper<T> inboundMessageMapper)
Sets the
SolaceIO.InboundMessageMapper that this SolaceIO.Read will use to map Solace messages into elements
of the resulting PCollection. |
SolaceIO.Read<T> |
withJcsmpProperties(com.solacesystems.jcsmp.JCSMPProperties jcsmpProperties)
Sets the JCSMP connection config for Solace PubSub+.
|
SolaceIO.Read<T> |
withMaxNumRecords(long maxNumRecords)
Sets the max number of records received by this
SolaceIO.Read. |
SolaceIO.Read<T> |
withMaxReadTime(org.joda.time.Duration maxReadTime)
Sets the max read time (duration) that this
SolaceIO.Read will receive messages. |
SolaceIO.Read<T> |
withQueues(List<String> queues)
Sets the list of pre-configured queues to which this
SolaceIO.Read will consume messages from. |
SolaceIO.Read<T> |
withUseSenderTimestamp(boolean useSenderTimestamp)
Sets whether or not for this
SolaceIO.Read to use the sender timestamp to determine the freshness of its
data. |
public SolaceIO.Read<T> withJcsmpProperties(com.solacesystems.jcsmp.JCSMPProperties jcsmpProperties)
Note: the JCSMP property JCSMPProperties.CLIENT_NAME must be null. This is because each
Apache Beam split has its own Solace session, and multiple sessions cannot share the same client name.
jcsmpProperties - Solace PubSub+ JCSMP connection configSolaceIO.Read configured with the provided JCSMPpublic SolaceIO.Read<T> withQueues(List<String> queues)
SolaceIO.Read will consume messages from.
For non-exclusive queues, you may add duplicate queue names in this list to create additional concurrent readers for them.
queues - list of queuesSolaceIO.Read configured with the provided queue listpublic SolaceIO.Read<T> withUseSenderTimestamp(boolean useSenderTimestamp)
SolaceIO.Read to use the sender timestamp to determine the freshness of its
data. Otherwise, the time at which Beam receives the data will be used.
By default, the latency measurement is taken from the time the message enters Dataflow and does not take
into account the time sitting in a Solace queue waiting to be processed. If messages are published with
sender timestamps and useSenderTimestamp is enabled in the SolaceIO, then end to end latencies will be used
and reported. For java clients the JCSMP property JCSMPProperties.GENERATE_SEND_TIMESTAMPS will
ensure that each message is sent with a timestamp.
Default:
useSenderTimestamp - set to true to use the data's sender timestamp to determine their freshnessSolaceIO.Read configured with the provided indication to use or not use sender
timestampspublic SolaceIO.Read<T> withAdvanceTimeoutInMillis(int advanceTimeoutInMillis)
SolaceIO.Read. If the poll timeout is passed, then this
SolaceIO.Read will treat that poll as a null message. i.e. no messages were available from the Solace PubSub+
source.
Default:
advanceTimeoutInMillis - the message polling timeout in millisecondsSolaceIO.Read configured with the provided advance timeoutpublic SolaceIO.Read<T> withMaxNumRecords(long maxNumRecords)
SolaceIO.Read. When this max
number of records is lower than Long.MAX_VALUE, the SolaceIO.Read will
provide a bounded PCollection.
Default: Long.MAX_VALUE
maxNumRecords - the maximum number of records to receiveSolaceIO.Read configured with the provided maximum number of recordspublic SolaceIO.Read<T> withMaxReadTime(org.joda.time.Duration maxReadTime)
SolaceIO.Read will receive messages.
When this max read time is not null, the SolaceIO.Read will provide a bounded PCollection.maxReadTime - the maximum time to receive messagesSolaceIO.Read configured with the provided maximum read timepublic SolaceIO.Read<T> withInboundMessageMapper(SolaceIO.InboundMessageMapper<T> inboundMessageMapper)
SolaceIO.InboundMessageMapper that this SolaceIO.Read will use to map Solace messages into elements
of the resulting PCollection.inboundMessageMapper - the message mapperSolaceIO.Read configured with the provided mapperSolaceIO.InboundMessageMapperpublic SolaceIO.Read<T> withCoder(org.apache.beam.sdk.coders.Coder<T> coder)
Coder that this SolaceIO.Read will use to encode and decode the elements of the resulting
PCollection.coder - the output coderSolaceIO.Read configured with the provided output coderCoderpublic org.apache.beam.sdk.values.PCollection<T> expand(org.apache.beam.sdk.values.PBegin input)
expand in class org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>public void populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
populateDisplayData in interface org.apache.beam.sdk.transforms.display.HasDisplayDatapopulateDisplayData in class org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<T>>Copyright © 2022 Solace. All rights reserved.