Class SessionTransactionSynchronization

  • All Implemented Interfaces:
    org.apache.camel.Ordered, org.apache.camel.spi.Synchronization, org.apache.camel.spi.SynchronizationRouteAware, org.apache.camel.spi.SynchronizationVetoable

    public class SessionTransactionSynchronization
    extends org.apache.camel.support.SynchronizationAdapter
    SessionTransactionSynchronization is called at the completion of each Exchange.

    The commit or rollback on the Session must be performed from the same thread that consumed the message.

    • Constructor Detail

      • SessionTransactionSynchronization

        public SessionTransactionSynchronization​(javax.jms.Session session,
                                                 TransactionCommitStrategy commitStrategy)
    • Method Detail

      • onFailure

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

        public void onComplete​(org.apache.camel.Exchange exchange)
        Specified by:
        onComplete in interface org.apache.camel.spi.Synchronization
        Overrides:
        onComplete in class org.apache.camel.support.SynchronizationAdapter
      • allowHandover

        public boolean allowHandover()
        Specified by:
        allowHandover in interface org.apache.camel.spi.SynchronizationVetoable
        Overrides:
        allowHandover in class org.apache.camel.support.SynchronizationAdapter