Class RollbackExchangeException

All Implemented Interfaces:
Serializable

public class RollbackExchangeException extends CamelExchangeException
Thrown (or explicitly constructed and set on an Exchange) to signal that the current exchange should be rolled back by the error handler.

When a route uses the rollback() DSL step or a Processor throws this exception, the Camel error handler treats it as an intentional rollback rather than an unexpected failure. Transactional resources enlisted in the exchange's unit of work will be rolled back accordingly.

See Also:
  • Constructor Details

    • RollbackExchangeException

      public RollbackExchangeException(Exchange exchange)
      Parameters:
      exchange - the exchange that is being rolled back
    • RollbackExchangeException

      public RollbackExchangeException(Exchange exchange, Throwable cause)
      Parameters:
      exchange - the exchange that is being rolled back
      cause - the cause of the rollback
    • RollbackExchangeException

      public RollbackExchangeException(String message, Exchange exchange)
      Parameters:
      message - the detail message
      exchange - the exchange that is being rolled back
    • RollbackExchangeException

      public RollbackExchangeException(String message, Exchange exchange, Throwable cause)
      Parameters:
      message - the detail message
      exchange - the exchange that is being rolled back
      cause - the cause of the rollback