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)
Applies this
PTransform on the given InputT, and returns its
Output. |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
void |
validate(PipelineOptions options)
Called before running the Pipeline to verify this transform is fully and correctly
specified.
|
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(Duration maxReadTime)
Define the max read time that the source will read.
|
JmsIO.Read |
withPassword(java.lang.String password)
Define the password to connect to the JMS broker (authenticated).
|
JmsIO.Read |
withQueue(java.lang.String queue)
Specify the JMS queue destination name where to read messages from.
|
JmsIO.Read |
withTopic(java.lang.String topic)
Specify the JMS topic destination name where to receive messages from.
|
JmsIO.Read |
withUsername(java.lang.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(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 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 withUsername(java.lang.String username)
public JmsIO.Read withPassword(java.lang.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(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)
PTransformPTransform on the given InputT, and returns its
Output.
Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
expand in class PTransform<PBegin,PCollection<JmsRecord>>public void validate(PipelineOptions options)
PTransformBy default, does nothing.
validate in class PTransform<PBegin,PCollection<JmsRecord>>public void populateDisplayData(DisplayData.Builder builder)
PTransformpopulateDisplayData(DisplayData.Builder) is invoked by Pipeline runners to collect
display data via DisplayData.from(HasDisplayData). Implementations may call
super.populateDisplayData(builder) in order to register display data in the current
namespace, but should otherwise use subcomponent.populateDisplayData(builder) to use
the namespace of the subcomponent.
By default, does not register any display data. Implementors may override this method to provide their own display data.
populateDisplayData in interface HasDisplayDatapopulateDisplayData in class PTransform<PBegin,PCollection<JmsRecord>>builder - The builder to populate with display data.HasDisplayData