Interface TransactionalEmitter<T>

Type Parameters:
T - payload type

public interface TransactionalEmitter<T>
Emitter for sending messages to a Pulsar channel in a transaction. Send methods immediately return by calling the underlying Emitter.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.pulsar.client.api.transaction.Transaction
    getTransaction(String producerName)
    Get the transaction
    boolean
    Is the current transaction marked for abort.
    void
    Mark the current transaction for abort.
    <M extends org.eclipse.microprofile.reactive.messaging.Message<? extends T>>
    void
    send(M msg)
    Sends a message to the Pulsar channel.
    void
    send(T payload)
    Sends a payload to the channel.
  • Method Details

    • send

      <M extends org.eclipse.microprofile.reactive.messaging.Message<? extends T>> void send(M msg)
      Sends a message to the Pulsar channel.

      Immediately returns without waiting for the result by dispatching the message to the underlying Emitter.

      Type Parameters:
      M - the Message type
      Parameters:
      msg - the Message to send, must not be null
      Throws:
      IllegalStateException - if the channel has been cancelled or terminated or if an overflow strategy of THROW_EXCEPTION or BUFFER is configured and the emitter overflows.
      See Also:
      • MutinyEmitter.sendMessageAndForget(Message)
    • send

      void send(T payload)
      Sends a payload to the channel.

      Immediately returns without waiting for the result by dispatching the message to the underlying Emitter.

      A Message object will be created to hold the payload.

      Parameters:
      payload - the thing to send, must not be null.
      See Also:
      • MutinyEmitter.sendAndForget(Object)
    • markForAbort

      void markForAbort()
      Mark the current transaction for abort.
    • isMarkedForAbort

      boolean isMarkedForAbort()
      Is the current transaction marked for abort.
    • getTransaction

      org.apache.pulsar.client.api.transaction.Transaction getTransaction(String producerName)
      Get the transaction

      Parameters:
      producerName - the producer name to participate in the transaction, can be null
      Returns:
      the transaction