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 TypeMethodDescriptionorg.apache.pulsar.client.api.transaction.TransactiongetTransaction(String producerName) Get the transactionbooleanIs the current transaction marked for abort.voidMark the current transaction for abort.<M extends org.eclipse.microprofile.reactive.messaging.Message<? extends T>>
voidsend(M msg) Sends a message to the Pulsar channel.voidSends a payload to the channel.
-
Method Details
-
send
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 benull- Throws:
IllegalStateException- if the channel has been cancelled or terminated or if an overflow strategy ofTHROW_EXCEPTIONorBUFFERis configured and the emitter overflows.- See Also:
-
MutinyEmitter.sendMessageAndForget(Message)
-
send
Sends a payload to the channel.Immediately returns without waiting for the result by dispatching the message to the underlying Emitter.
A
Messageobject will be created to hold the payload.- Parameters:
payload- the thing to send, must not benull.- 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
Get the transaction- Parameters:
producerName- the producer name to participate in the transaction, can benull- Returns:
- the transaction
-