Class CamelMessage<T>

  • All Implemented Interfaces:
    Message<T>

    public class CamelMessage<T>
    extends Object
    implements Message<T>
    • Constructor Detail

      • CamelMessage

        public CamelMessage​(org.apache.camel.Exchange exchange,
                            CamelFailureHandler onNack)
    • Method Detail

      • getPayload

        public T getPayload()
        Specified by:
        getPayload in interface Message<T>
        Returns:
        The payload for this message.
      • getPayload

        public T getPayload​(Class<T> clazz)
      • getExchange

        public org.apache.camel.Exchange getExchange()
      • getMetadata

        public Metadata getMetadata()
        Specified by:
        getMetadata in interface Message<T>
        Returns:
        The set of metadata attached to this message, potentially empty.
      • nack

        public CompletionStage<Void> nack​(Throwable reason)
        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.
        Specified by:
        nack in interface Message<T>
        Parameters:
        reason - the reason of the nack, must not be null
        Returns:
        a completion stage completed when the message is negative-acknowledgement has completed. If the negative acknowledgement fails, the completion stage propagates the failure.