Class IdempotentOnCompletion

  • All Implemented Interfaces:
    org.apache.camel.spi.Synchronization

    public class IdempotentOnCompletion
    extends Object
    implements org.apache.camel.spi.Synchronization
    On completion strategy for IdempotentConsumer.

    This strategy adds the message id to the idempotent repository in cast the exchange was processed successfully. In case of failure the message id is not added.

    • Constructor Detail

      • IdempotentOnCompletion

        public IdempotentOnCompletion​(org.apache.camel.spi.IdempotentRepository idempotentRepository,
                                      String messageId,
                                      boolean eager,
                                      boolean removeOnFailure)
    • Method Detail

      • onComplete

        public void onComplete​(org.apache.camel.Exchange exchange)
        Specified by:
        onComplete in interface org.apache.camel.spi.Synchronization
      • onFailure

        public void onFailure​(org.apache.camel.Exchange exchange)
        Specified by:
        onFailure in interface org.apache.camel.spi.Synchronization
      • onCompletedMessage

        protected void onCompletedMessage​(org.apache.camel.Exchange exchange,
                                          String messageId)
        A strategy method to allow derived classes to overload the behavior of processing a completed message
        Parameters:
        exchange - the exchange
        messageId - the message ID of this exchange
      • onFailedMessage

        protected void onFailedMessage​(org.apache.camel.Exchange exchange,
                                       String messageId)
        A strategy method to allow derived classes to overload the behavior of processing a failed message
        Parameters:
        exchange - the exchange
        messageId - the message ID of this exchange