public abstract static class JmsIO.Read extends PTransform<PBegin,PCollection<JmsRecord>>
PTransform to read from a JMS destination. See JmsIO for more
information on usage and configuration.name| Constructor and Description |
|---|
Read() |
| Modifier and Type | Method and Description |
|---|---|
PCollection<JmsRecord> |
expand(PBegin input) |
void |
populateDisplayData(DisplayData.Builder builder) |
void |
validate(PipelineOptions options) |
JmsIO.Read |
withConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
Specify the JMS connection factory to connect to the JMS broker.
|
JmsIO.Read |
withMaxNumRecords(long maxNumRecords)
Define the max number of records that the source will read.
|
JmsIO.Read |
withMaxReadTime(org.joda.time.Duration maxReadTime)
Define the max read time that the source will read.
|
JmsIO.Read |
withPassword(String password)
Define the password to connect to the JMS broker (authenticated).
|
JmsIO.Read |
withQueue(String queue)
Specify the JMS queue destination name where to read messages from.
|
JmsIO.Read |
withTopic(String topic)
Specify the JMS topic destination name where to receive messages from.
|
JmsIO.Read |
withUsername(String username)
Define the username to connect to the JMS broker (authenticated).
|
getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, toStringpublic JmsIO.Read withConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
For instance:
pipeline.apply(JmsIO.read().withConnectionFactory(myConnectionFactory)
connectionFactory - The JMS ConnectionFactory.JmsIO.Read.public JmsIO.Read withQueue(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 withTopic(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 withUsername(String username)
public JmsIO.Read withPassword(String password)
public JmsIO.Read 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 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 PCollection<JmsRecord> expand(PBegin input)
expand in class PTransform<PBegin,PCollection<JmsRecord>>public void validate(PipelineOptions options)
validate in class PTransform<PBegin,PCollection<JmsRecord>>public void populateDisplayData(DisplayData.Builder builder)
populateDisplayData in interface HasDisplayDatapopulateDisplayData in class PTransform<PBegin,PCollection<JmsRecord>>Copyright © 2016–2017 The Apache Software Foundation. All rights reserved.