Package org.apache.beam.sdk.io.rabbitmq
Class RabbitMqIO.Write
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<RabbitMqMessage>,PCollection<?>>
org.apache.beam.sdk.io.rabbitmq.RabbitMqIO.Write
- All Implemented Interfaces:
Serializable
,HasDisplayData
- Enclosing class:
RabbitMqIO
public abstract static class RabbitMqIO.Write
extends PTransform<PCollection<RabbitMqMessage>,PCollection<?>>
A
PTransform
to publish messages to a RabbitMQ server.- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPCollection
<?> expand
(PCollection<RabbitMqMessage> input) Override this method to specify how thisPTransform
should be expanded on the givenInputT
.withExchange
(String exchange) Defines the existing exchange where the messages will be sent.withExchange
(String exchange, String exchangeType) Defines the to-be-declared exchange where the messages will be sent.Defines the queue where the messages will be sent.withQueueDeclare
(boolean queueDeclare) If the queue is not declared by another application,RabbitMqIO
can declare the queue itself.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Constructor Details
-
Write
public Write()
-
-
Method Details
-
withUri
-
withExchange
Defines the to-be-declared exchange where the messages will be sent. By defining the exchange via this function, RabbitMqIO will be responsible for declaring this exchange, and will declare it as non-durable. If an exchange with this name already exists but is non-durable or of a different type, the declaration will fail.By calling this function
exchangeDeclare
will be set totrue
.To publish to an existing exchange, use
withExchange(String)
-
withExchange
Defines the existing exchange where the messages will be sent.By calling this function
exchangeDeclare
will be set tofalse
-
withQueue
Defines the queue where the messages will be sent. The queue has to be declared. It can be done by another application or byRabbitMqIO
if you setwithQueueDeclare(boolean)
totrue
. -
withQueueDeclare
If the queue is not declared by another application,RabbitMqIO
can declare the queue itself.- Parameters:
queueDeclare
-true
to declare the queue,false
else.
-
expand
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
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).
- Specified by:
expand
in classPTransform<PCollection<RabbitMqMessage>,
PCollection<?>>
-