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 TypeFieldDescriptionfinal io.vertx.rabbitmq.RabbitMQMessageprotected org.eclipse.microprofile.reactive.messaging.Metadataprotected final IncomingRabbitMQMetadataFields inherited from interface org.eclipse.microprofile.reactive.messaging.Message
EMPTY_ACK, EMPTY_NACK, LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionIncomingRabbitMQMessage(io.vertx.mutiny.rabbitmq.RabbitMQMessage delegate, ClientHolder holder, RabbitMQFailureHandler onNack, RabbitMQAckHandler onAck, String contentTypeOverride) -
Method Summary
Modifier and TypeMethodDescriptionack(org.eclipse.microprofile.reactive.messaging.Metadata metadata) voidAcknowledges the message.Function<org.eclipse.microprofile.reactive.messaging.Metadata,CompletionStage<Void>> getAppId()getCreationTime(ZoneId zoneId) Deprecated.Use getTimestamp()org.eclipse.microprofile.reactive.messaging.MetadataBiFunction<Throwable,org.eclipse.microprofile.reactive.messaging.Metadata, CompletionStage<Void>> 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
ack, addMetadata, getAck, getMetadata, getNack, nack, thenApply, unwrap, withAck, withAckWithMetadata, withMetadata, withMetadata, withNack, withNackWithMetadata, withPayload
-
Field Details
-
message
public final io.vertx.rabbitmq.RabbitMQMessage message -
metadata
protected org.eclipse.microprofile.reactive.messaging.Metadata metadata -
rabbitMQMetadata
-
-
Constructor Details
-
IncomingRabbitMQMessage
public IncomingRabbitMQMessage(io.vertx.mutiny.rabbitmq.RabbitMQMessage delegate, ClientHolder holder, RabbitMQFailureHandler onNack, RabbitMQAckHandler onAck, String contentTypeOverride)
-
-
Method Details
-
getAckWithMetadata
public Function<org.eclipse.microprofile.reactive.messaging.Metadata,CompletionStage<Void>> getAckWithMetadata()- Specified by:
getAckWithMetadatain interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
getNackWithMetadata
public BiFunction<Throwable,org.eclipse.microprofile.reactive.messaging.Metadata, getNackWithMetadata()CompletionStage<Void>> - Specified by:
getNackWithMetadatain 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>
-