public abstract static class JmsIO.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 JMS destination. See JmsIO for more information on
usage and configuration.| 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) |
JmsIO.Read<T> |
withCoder(org.apache.beam.sdk.coders.Coder<T> coder) |
JmsIO.Read<T> |
withConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
Specify the JMS connection factory to connect to the JMS broker.
|
JmsIO.Read<T> |
withMaxNumRecords(long maxNumRecords)
Define the max number of records that the source will read.
|
JmsIO.Read<T> |
withMaxReadTime(org.joda.time.Duration maxReadTime)
Define the max read time that the source will read.
|
JmsIO.Read<T> |
withMessageMapper(JmsIO.MessageMapper<T> messageMapper) |
JmsIO.Read<T> |
withPassword(java.lang.String password)
Define the password to connect to the JMS broker (authenticated).
|
JmsIO.Read<T> |
withQueue(java.lang.String queue)
Specify the JMS queue destination name where to read messages from.
|
JmsIO.Read<T> |
withTopic(java.lang.String topic)
Specify the JMS topic destination name where to receive messages from.
|
JmsIO.Read<T> |
withUsername(java.lang.String username)
Define the username to connect to the JMS broker (authenticated).
|
public JmsIO.Read<T> withConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
For instance:
pipeline.apply(JmsIO.read().withConnectionFactory(myConnectionFactory)
connectionFactory - The JMS ConnectionFactory.JmsIO.Read.public JmsIO.Read<T> withQueue(java.lang.String queue)
JmsIO.Read
acts as a consumer on the queue.
This method is exclusive with withTopic(String). The user has to
specify a destination: queue or topic.
For instance:
pipeline.apply(JmsIO.read().withQueue("my-queue")
queue - The JMS queue name where to read messages from.JmsIO.Read.public JmsIO.Read<T> withTopic(java.lang.String topic)
JmsIO.Read
acts as a subscriber on the topic.
This method is exclusive with withQueue(String). The user has to
specify a destination: queue or topic.
For instance:
pipeline.apply(JmsIO.read().withTopic("my-topic")
topic - The JMS topic name.JmsIO.Read.public JmsIO.Read<T> withUsername(java.lang.String username)
public JmsIO.Read<T> withPassword(java.lang.String password)
public JmsIO.Read<T> withMaxNumRecords(long maxNumRecords)
Long.MAX_VALUE means the source will be Bounded, and will stop
once the max number of records read is reached.
For instance:
pipeline.apply(JmsIO.read().withNumRecords(1000)
maxNumRecords - The max number of records to read from the JMS destination.JmsIO.Read.public JmsIO.Read<T> withMaxReadTime(org.joda.time.Duration maxReadTime)
Bounded, and will stop once the max read time is reached.
For instance:
pipeline.apply(JmsIO.read().withMaxReadTime(Duration.minutes(10))
maxReadTime - The max read time duration.JmsIO.Read.public JmsIO.Read<T> withMessageMapper(JmsIO.MessageMapper<T> messageMapper)
public JmsIO.Read<T> withCoder(org.apache.beam.sdk.coders.Coder<T> coder)
public 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>>