Class IncomingRabbitMQMessage<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.rabbitmq.IncomingRabbitMQMessage<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected io.vertx.rabbitmq.RabbitMQMessage
message
protected Metadata
metadata
protected RabbitMQAckHandler
onAck
protected RabbitMQFailureHandler
onNack
protected IncomingRabbitMQMetadata
rabbitMQMetadata
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.microprofile.reactive.messaging.Message
addMetadata, getMetadata, nack, unwrap, withAck, withMetadata, withMetadata, withNack, withPayload
-
-
-
-
Field Detail
-
message
protected final io.vertx.rabbitmq.RabbitMQMessage message
-
metadata
protected Metadata metadata
-
rabbitMQMetadata
protected final IncomingRabbitMQMetadata rabbitMQMetadata
-
onNack
protected final RabbitMQFailureHandler onNack
-
onAck
protected final RabbitMQAckHandler onAck
-
-
Method Detail
-
getAck
public Supplier<CompletionStage<Void>> getAck()
- Specified by:
getAck
in interfaceMessage<T>
- Returns:
- the supplier used to retrieve the acknowledgement
CompletionStage
.
-
getNack
public Function<Throwable,CompletionStage<Void>> getNack()
-
ack
public CompletionStage<Void> ack()
Description copied from interface:Message
Acknowledge this message.
-
nack
public CompletionStage<Void> nack(Throwable reason, Metadata metadata)
Description copied from interface:Message
Acknowledge negatively this message.nack
is used to indicate that the processing of a message failed. The reason is passed as parameter. Additional metadata may be provided that the connector can use when nacking the message. The interpretation of metadata is connector-specific.- Specified by:
nack
in interfaceMessage<T>
- Parameters:
reason
- the reason of the nack, must not benull
metadata
- additional nack metadata the connector may use, may benull
- Returns:
- a completion stage completed when the message is negative-acknowledgement has completed. If the negative acknowledgement fails, the completion stage propagates the failure.
-
acknowledgeMessage
public void acknowledgeMessage()
Acknowledges the message.
-
rejectMessage
public void rejectMessage(Throwable reason)
Rejects the message by nack'ing with requeue=false; this will either discard the message for good or (if a DLQ has been set up) send it to the DLQ.- Parameters:
reason
- the cause of the rejection, which must not be null
-
getPayload
public T getPayload()
- Specified by:
getPayload
in interfaceMessage<T>
- Returns:
- The payload for this message.
-
getMetadata
public Metadata getMetadata()
- Specified by:
getMetadata
in interfaceMessage<T>
- Returns:
- The set of metadata attached to this message, potentially empty.
-
getCreationTime
public Optional<ZonedDateTime> getCreationTime(ZoneId zoneId)
-
getRabbitMQMessage
public io.vertx.mutiny.rabbitmq.RabbitMQMessage getRabbitMQMessage()
-
injectTracingMetadata
public void injectTracingMetadata(TracingMetadata tracingMetadata)
-
-