Class AmqpMessage<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.amqp.AmqpMessage<T>
-
- All Implemented Interfaces:
Message<T>
- Direct Known Subclasses:
OutgoingAmqpMessage
public class AmqpMessage<T> extends Object implements Message<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected IncomingAmqpMetadata
amqpMetadata
protected static String
APPLICATION_JSON
protected io.vertx.amqp.AmqpMessage
message
protected Metadata
metadata
protected AmqpFailureHandler
onNack
-
Constructor Summary
Constructors Constructor Description AmqpMessage(io.vertx.amqp.AmqpMessage msg, io.vertx.mutiny.core.Context context, AmqpFailureHandler onNack, boolean cloudEventEnabled, Boolean tracingEnabled)
AmqpMessage(io.vertx.mutiny.amqp.AmqpMessage delegate, io.vertx.mutiny.core.Context context, AmqpFailureHandler onNack, boolean cloudEventEnabled, Boolean tracingEnabled)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.microprofile.reactive.messaging.Message
addMetadata, getMetadata, nack, unwrap, withAck, withMetadata, withMetadata, withNack, withPayload
-
-
-
-
Field Detail
-
APPLICATION_JSON
protected static final String APPLICATION_JSON
- See Also:
- Constant Field Values
-
message
protected final io.vertx.amqp.AmqpMessage message
-
metadata
protected Metadata metadata
-
amqpMetadata
protected final IncomingAmqpMetadata amqpMetadata
-
onNack
protected final AmqpFailureHandler onNack
-
-
Constructor Detail
-
AmqpMessage
public AmqpMessage(io.vertx.mutiny.amqp.AmqpMessage delegate, io.vertx.mutiny.core.Context context, AmqpFailureHandler onNack, boolean cloudEventEnabled, Boolean tracingEnabled)
-
AmqpMessage
public AmqpMessage(io.vertx.amqp.AmqpMessage msg, io.vertx.mutiny.core.Context context, AmqpFailureHandler onNack, boolean cloudEventEnabled, Boolean tracingEnabled)
-
-
Method Detail
-
builder
@Deprecated public static <T> AmqpMessageBuilder<T> builder()
Deprecated.
-
ack
public CompletionStage<Void> ack()
Description copied from interface:Message
Acknowledge this message.
-
nack
public CompletionStage<Void> nack(Throwable reason, Metadata metadata)
Description copied from interface:Message
Acknowledge negatively this message.nack
is used to indicate that the processing of a message failed. The reason is passed as parameter. Additional metadata may be provided that the connector can use when nacking the message. The interpretation of metadata is connector-specific.- Specified by:
nack
in interfaceMessage<T>
- Parameters:
reason
- the reason of the nack, must not benull
metadata
- additional nack metadata the connector may use, may benull
- Returns:
- a completion stage completed when the message is negative-acknowledgement has completed. If the negative acknowledgement fails, the completion stage propagates the failure.
-
getPayload
public T getPayload()
- Specified by:
getPayload
in interfaceMessage<T>
- Returns:
- The payload for this message.
-
getMetadata
public Metadata getMetadata()
- Specified by:
getMetadata
in interfaceMessage<T>
- Returns:
- The set of metadata attached to this message, potentially empty.
-
unwrap
public org.apache.qpid.proton.message.Message unwrap()
-
isDurable
public boolean isDurable()
-
getDeliveryCount
public long getDeliveryCount()
-
getPriority
public int getPriority()
-
getTtl
public long getTtl()
-
getMessageId
public Object getMessageId()
-
getGroupSequence
public long getGroupSequence()
-
getCreationTime
public long getCreationTime()
-
getAddress
public String getAddress()
-
getGroupId
public String getGroupId()
-
getContentType
public String getContentType()
-
getExpiryTime
public long getExpiryTime()
-
getCorrelationId
public Object getCorrelationId()
-
getContentEncoding
public String getContentEncoding()
-
getSubject
public String getSubject()
-
getApplicationProperties
public io.vertx.core.json.JsonObject getApplicationProperties()
-
getBody
public org.apache.qpid.proton.amqp.messaging.Section getBody()
-
getError
public org.apache.qpid.proton.message.MessageError getError()
-
getAmqpMessage
public io.vertx.mutiny.amqp.AmqpMessage getAmqpMessage()
-
getAck
public Supplier<CompletionStage<Void>> getAck()
- Specified by:
getAck
in interfaceMessage<T>
- Returns:
- the supplier used to retrieve the acknowledgement
CompletionStage
.
-
getNack
public Function<Throwable,CompletionStage<Void>> getNack()
-
injectTracingMetadata
public void injectTracingMetadata(TracingMetadata tracingMetadata)
-
-