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)
Override this method to specify how this
PTransform should be expanded
on the given InputT . |
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, toString
public 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)
PTransform
PTransform
should be expanded
on the given InputT
.
NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to the InputT
using the apply
method.
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)
PTransform
By default, does nothing.
validate
in class PTransform<PBegin,PCollection<JmsRecord>>
public void populateDisplayData(DisplayData.Builder builder)
PTransform
populateDisplayData(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 HasDisplayData
populateDisplayData
in class PTransform<PBegin,PCollection<JmsRecord>>
builder
- The builder to populate with display data.HasDisplayData