Class IncomingRabbitMQMessage<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.rabbitmq.IncomingRabbitMQMessage<T>
-
- Type Parameters:
T
- the message body type
- All Implemented Interfaces:
org.eclipse.microprofile.reactive.messaging.Message<T>
public class IncomingRabbitMQMessage<T> extends Object implements org.eclipse.microprofile.reactive.messaging.Message<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 RabbitMQAckHandler
onAck
protected RabbitMQFailureHandler
onNack
protected IncomingRabbitMQMetadata
rabbitMQMetadata
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<Void>
ack()
void
acknowledgeMessage()
Acknowledges the message.Supplier<CompletionStage<Void>>
getAck()
Optional<String>
getContentEncoding()
Optional<String>
getContentType()
Optional<String>
getCorrelationId()
Optional<ZonedDateTime>
getCreationTime(ZoneId zoneId)
Map<String,Object>
getHeaders()
Optional<String>
getMessageId()
org.eclipse.microprofile.reactive.messaging.Metadata
getMetadata()
Function<Throwable,CompletionStage<Void>>
getNack()
T
getPayload()
Optional<Integer>
getPriority()
io.vertx.mutiny.rabbitmq.RabbitMQMessage
getRabbitMQMessage()
Optional<String>
getReplyTo()
Optional<String>
getUserId()
void
injectTracingMetadata(TracingMetadata tracingMetadata)
CompletionStage<Void>
nack(Throwable reason, org.eclipse.microprofile.reactive.messaging.Metadata metadata)
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.
-
-
-
Field Detail
-
message
protected final io.vertx.rabbitmq.RabbitMQMessage message
-
metadata
protected org.eclipse.microprofile.reactive.messaging.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 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>
-
getCreationTime
public Optional<ZonedDateTime> getCreationTime(ZoneId zoneId)
-
getRabbitMQMessage
public io.vertx.mutiny.rabbitmq.RabbitMQMessage getRabbitMQMessage()
-
injectTracingMetadata
public void injectTracingMetadata(TracingMetadata tracingMetadata)
-
-