Class 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:
  • Constructor Details

    • Write

      public Write()
  • Method Details

    • withUri

      public RabbitMqIO.Write withUri(String uri)
    • withExchange

      public RabbitMqIO.Write withExchange(String exchange, String exchangeType)
      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 to true.

      To publish to an existing exchange, use withExchange(String)

    • withExchange

      public RabbitMqIO.Write withExchange(String exchange)
      Defines the existing exchange where the messages will be sent.

      By calling this function exchangeDeclare will be set to false

    • withQueue

      public RabbitMqIO.Write withQueue(String queue)
      Defines the queue where the messages will be sent. The queue has to be declared. It can be done by another application or by RabbitMqIO if you set withQueueDeclare(boolean) to true.
    • withQueueDeclare

      public RabbitMqIO.Write withQueueDeclare(boolean queueDeclare)
      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

      public PCollection<?> expand(PCollection<RabbitMqMessage> input)
      Description copied from class: PTransform
      Override this method to specify how this 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).

      Specified by:
      expand in class PTransform<PCollection<RabbitMqMessage>,PCollection<?>>