Class CamelMessage<T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.camel.CamelMessage<T>
-
-
Constructor Summary
Constructors Constructor Description CamelMessage(org.apache.camel.Exchange exchange, CamelFailureHandler onNack)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.Exchange
getExchange()
Metadata
getMetadata()
Function<Throwable,CompletionStage<Void>>
getNack()
T
getPayload()
T
getPayload(Class<T> clazz)
CompletionStage<Void>
nack(Throwable reason, Metadata metadata)
Acknowledge negatively this message.-
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
ack, addMetadata, getAck, getMetadata, nack, unwrap, withAck, withMetadata, withMetadata, withNack, withPayload
-
-
-
-
Constructor Detail
-
CamelMessage
public CamelMessage(org.apache.camel.Exchange exchange, CamelFailureHandler onNack)
-
-
Method Detail
-
getPayload
public T getPayload()
- Specified by:
getPayload
in interfaceMessage<T>
- Returns:
- The payload for this message.
-
getExchange
public org.apache.camel.Exchange getExchange()
-
getMetadata
public Metadata getMetadata()
- Specified by:
getMetadata
in interfaceMessage<T>
- Returns:
- The set of metadata attached to this message, potentially empty.
-
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.
-
-