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>,MetadataInjectableMessage<T>,org.eclipse.microprofile.reactive.messaging.Message<T>
public class IncomingRabbitMQMessage<T>
extends Object
implements ContextAwareMessage<T>, MetadataInjectableMessage<T>
An implementation of
Message suitable for incoming RabbitMQ messages.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.vertx.rabbitmq.RabbitMQMessageprotected org.eclipse.microprofile.reactive.messaging.Metadataprotected final IncomingRabbitMQMetadataFields inherited from interface org.eclipse.microprofile.reactive.messaging.Message
LOGGER -
Method Summary
Modifier and TypeMethodDescriptionack()voidAcknowledges the message.getAck()getAppId()getCreationTime(ZoneId zoneId) Deprecated.Use getTimestamp()org.eclipse.microprofile.reactive.messaging.MetadatagetNack()io.vertx.mutiny.rabbitmq.RabbitMQMessagegetTimestamp(ZoneId zoneId) getType()voidinjectMetadata(Object metadataObject) voidrejectMessage(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.voidrejectMessage(Throwable reason, boolean requeue) Rejects the message by nack'ing it.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.smallrye.reactive.messaging.providers.locals.ContextAwareMessage
getContextMetadata, runOnMessageContextMethods inherited from interface org.eclipse.microprofile.reactive.messaging.Message
addMetadata, getMetadata, nack, unwrap, withAck, withMetadata, withMetadata, withNack, withPayload
-
Field Details
-
message
protected final io.vertx.rabbitmq.RabbitMQMessage message -
metadata
protected org.eclipse.microprofile.reactive.messaging.Metadata metadata -
rabbitMQMetadata
-
-
Method Details
-
getAck
- Specified by:
getAckin interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
getNack
- Specified by:
getNackin interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
ack
- Specified by:
ackin interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
nack
public CompletionStage<Void> nack(Throwable reason, org.eclipse.microprofile.reactive.messaging.Metadata metadata) - Specified by:
nackin interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
acknowledgeMessage
public void acknowledgeMessage()Acknowledges the message. -
rejectMessage
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
-
rejectMessage
Rejects the message by nack'ing it.This will either discard the message for good, requeue (if requeue=true is set) or (if a DLQ has been set up) send it to the DLQ.
Please note that requeue is potentially dangerous as it can lead to very high load if all consumers reject and requeue a message repeatedly.
- Parameters:
reason- the cause of the rejection, which must not be nullrequeue- the requeue flag
-
getPayload
- Specified by:
getPayloadin interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
getMetadata
public org.eclipse.microprofile.reactive.messaging.Metadata getMetadata()- Specified by:
getMetadatain interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
getHeaders
-
getContentType
-
getContentEncoding
-
getDeliveryMode
-
getPriority
-
getCorrelationId
-
getReplyTo
-
getExpiration
-
getMessageId
-
getTimestamp
-
getType
-
getUserId
-
getAppId
-
getCreationTime
Deprecated.Use getTimestamp() -
getRabbitMQMessage
public io.vertx.mutiny.rabbitmq.RabbitMQMessage getRabbitMQMessage() -
injectMetadata
- Specified by:
injectMetadatain interfaceMetadataInjectableMessage<T>
-