Class IncomingRabbitMQMessage<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.rabbitmq.IncomingRabbitMQMessage<T>
-
- Type Parameters:
T
- the message body type
- All Implemented Interfaces:
ContextAwareMessage<T>
,org.eclipse.microprofile.reactive.messaging.Message<T>
public class IncomingRabbitMQMessage<T> extends Object implements ContextAwareMessage<T>
An implementation ofMessage
suitable for incoming RabbitMQ messages.
-
-
Field Summary
Fields Modifier and Type Field Description protected io.vertx.rabbitmq.RabbitMQMessage
message
protected org.eclipse.microprofile.reactive.messaging.Metadata
metadata
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 io.smallrye.reactive.messaging.providers.locals.ContextAwareMessage
getContextMetadata, runOnMessageContext
-
-
-
-
Field Detail
-
message
protected final io.vertx.rabbitmq.RabbitMQMessage message
-
metadata
protected org.eclipse.microprofile.reactive.messaging.Metadata metadata
-
rabbitMQMetadata
protected final IncomingRabbitMQMetadata rabbitMQMetadata
-
-
Method Detail
-
getAck
public Supplier<CompletionStage<Void>> getAck()
- Specified by:
getAck
in interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
getNack
public Function<Throwable,CompletionStage<Void>> getNack()
- Specified by:
getNack
in interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
ack
public CompletionStage<Void> ack()
- Specified by:
ack
in interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
nack
public CompletionStage<Void> nack(Throwable reason, org.eclipse.microprofile.reactive.messaging.Metadata metadata)
- Specified by:
nack
in interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
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 interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
getMetadata
public org.eclipse.microprofile.reactive.messaging.Metadata getMetadata()
- Specified by:
getMetadata
in interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
getTimestamp
public Optional<ZonedDateTime> getTimestamp(ZoneId zoneId)
-
getCreationTime
@Deprecated public Optional<ZonedDateTime> getCreationTime(ZoneId zoneId)
Deprecated.Use getTimestamp()
-
getRabbitMQMessage
public io.vertx.mutiny.rabbitmq.RabbitMQMessage getRabbitMQMessage()
-
injectTracingMetadata
public void injectTracingMetadata(io.smallrye.reactive.messaging.TracingMetadata tracingMetadata)
-
-