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
Modifier and TypeFieldDescriptionfinal io.vertx.rabbitmq.RabbitMQMessage
protected org.eclipse.microprofile.reactive.messaging.Metadata
protected final IncomingRabbitMQMetadata
Fields inherited from interface org.eclipse.microprofile.reactive.messaging.Message
EMPTY_ACK, EMPTY_NACK, LOGGER
-
Constructor Summary
ConstructorDescriptionIncomingRabbitMQMessage
(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) void
Acknowledges the message.Function<org.eclipse.microprofile.reactive.messaging.Metadata,
CompletionStage<Void>> getAppId()
getCreationTime
(ZoneId zoneId) Deprecated.Use getTimestamp()org.eclipse.microprofile.reactive.messaging.Metadata
BiFunction<Throwable,
org.eclipse.microprofile.reactive.messaging.Metadata, CompletionStage<Void>> io.vertx.mutiny.rabbitmq.RabbitMQMessage
getTimestamp
(ZoneId zoneId) getType()
void
injectMetadata
(Object metadataObject) 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.void
rejectMessage
(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, wait
Methods inherited from interface io.smallrye.reactive.messaging.providers.locals.ContextAwareMessage
getContextMetadata, runOnMessageContext
Methods 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:
getAckWithMetadata
in interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
getNackWithMetadata
public BiFunction<Throwable,org.eclipse.microprofile.reactive.messaging.Metadata, getNackWithMetadata()CompletionStage<Void>> - Specified by:
getNackWithMetadata
in interfaceorg.eclipse.microprofile.reactive.messaging.Message<T>
-
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
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:
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>
-
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:
injectMetadata
in interfaceMetadataInjectableMessage<T>
-