Class LegacyDefaultErrorHandlerBuilder

    • Constructor Detail

      • LegacyDefaultErrorHandlerBuilder

        public LegacyDefaultErrorHandlerBuilder()
        Deprecated.
    • Method Detail

      • cloneBuilder

        public LegacyErrorHandlerBuilder cloneBuilder()
        Deprecated.
        Specified by:
        cloneBuilder in interface org.apache.camel.ErrorHandlerFactory
      • retriesExhaustedLogLevel

        public LegacyDefaultErrorHandlerBuilder retriesExhaustedLogLevel​(org.apache.camel.LoggingLevel retriesExhaustedLogLevel)
        Deprecated.
      • asyncDelayedRedelivery

        public LegacyDefaultErrorHandlerBuilder asyncDelayedRedelivery()
        Deprecated.
        Will allow asynchronous delayed redeliveries. The route, in particular the consumer's component, must support the Asynchronous Routing Engine (e.g. seda)
        Returns:
        the builder
        See Also:
        RedeliveryPolicy.setAsyncDelayedRedelivery(boolean)
      • allowRedeliveryWhileStopping

        public LegacyDefaultErrorHandlerBuilder allowRedeliveryWhileStopping​(boolean allowRedeliveryWhileStopping)
        Deprecated.
        Controls whether to allow redelivery while stopping/shutting down a route that uses error handling.
        Parameters:
        allowRedeliveryWhileStopping - true to allow redelivery, false to reject redeliveries
        Returns:
        the builder
      • executorServiceRef

        public LegacyDefaultErrorHandlerBuilder executorServiceRef​(String ref)
        Deprecated.
        Sets a reference to a thread pool to be used for redelivery.
        Parameters:
        ref - reference to a scheduled thread pool
        Returns:
        the builder.
      • logger

        public LegacyDefaultErrorHandlerBuilder logger​(org.apache.camel.spi.CamelLogger logger)
        Deprecated.
        Sets the logger used for caught exceptions
        Parameters:
        logger - the logger
        Returns:
        the builder
      • loggingLevel

        public LegacyDefaultErrorHandlerBuilder loggingLevel​(org.apache.camel.LoggingLevel level)
        Deprecated.
        Sets the logging level of exceptions caught
        Parameters:
        level - the logging level
        Returns:
        the builder
      • log

        public LegacyDefaultErrorHandlerBuilder log​(org.slf4j.Logger log)
        Deprecated.
        Sets the log used for caught exceptions
        Parameters:
        log - the logger
        Returns:
        the builder
      • onRedelivery

        public LegacyDefaultErrorHandlerBuilder onRedelivery​(org.apache.camel.Processor processor)
        Deprecated.
        Sets a processor that should be processed before a redelivery attempt.

        Can be used to change the Exchange before its being redelivered.

        Parameters:
        processor - the processor
        Returns:
        the builder
      • retryWhile

        public LegacyDefaultErrorHandlerBuilder retryWhile​(org.apache.camel.Expression retryWhile)
        Deprecated.
        Sets the retry while expression.

        Will continue retrying until expression evaluates to false.

        Parameters:
        retryWhile - expression that determines when to stop retrying
        Returns:
        the builder
      • useOriginalMessage

        public LegacyDefaultErrorHandlerBuilder useOriginalMessage()
        Deprecated.
        Will use the original input Message (original body and headers) when an Exchange is moved to the dead letter queue.

        Notice: this only applies when all redeliveries attempt have failed and the Exchange is doomed for failure.
        Instead of using the current inprogress Exchange IN message we use the original IN message instead. This allows you to store the original input in the dead letter queue instead of the inprogress snapshot of the IN message. For instance if you route transform the IN body during routing and then failed. With the original exchange store in the dead letter queue it might be easier to manually re submit the Exchange again as the IN message is the same as when Camel received it. So you should be able to send the Exchange to the same input.

        The difference between useOriginalMessage and useOriginalBody is that the former includes both the original body and headers, where as the latter only includes the original body. You can use the latter to enrich the message with custom headers and include the original message body. The former wont let you do this, as its using the original message body and headers as they are. You cannot enable both useOriginalMessage and useOriginalBody.

        Important: The original input means the input message that are bounded by the current UnitOfWork. An unit of work typically spans one route, or multiple routes if they are connected using internal endpoints such as direct or seda. When messages is passed via external endpoints such as JMS or HTTP then the consumer will create a new unit of work, with the message it received as input as the original input. Also some EIP patterns such as splitter, multicast, will create a new unit of work boundary for the messages in their sub-route (eg the split message); however these EIPs have an option named shareUnitOfWork which allows to combine with the parent unit of work in regard to error handling and therefore use the parent original message.

        By default this feature is off.

        Returns:
        the builder
        See Also:
        useOriginalBody()
      • useOriginalBody

        public LegacyDefaultErrorHandlerBuilder useOriginalBody()
        Deprecated.
        Will use the original input Message body (original body only) when an Exchange is moved to the dead letter queue.

        Notice: this only applies when all redeliveries attempt have failed and the Exchange is doomed for failure.
        Instead of using the current inprogress Exchange IN message we use the original IN message instead. This allows you to store the original input in the dead letter queue instead of the inprogress snapshot of the IN message. For instance if you route transform the IN body during routing and then failed. With the original exchange store in the dead letter queue it might be easier to manually re submit the Exchange again as the IN message is the same as when Camel received it. So you should be able to send the Exchange to the same input.

        The difference between useOriginalMessage and useOriginalBody is that the former includes both the original body and headers, where as the latter only includes the original body. You can use the latter to enrich the message with custom headers and include the original message body. The former wont let you do this, as its using the original message body and headers as they are. You cannot enable both useOriginalMessage and useOriginalBody.

        Important: The original input means the input message that are bounded by the current UnitOfWork. An unit of work typically spans one route, or multiple routes if they are connected using internal endpoints such as direct or seda. When messages is passed via external endpoints such as JMS or HTTP then the consumer will create a new unit of work, with the message it received as input as the original input. Also some EIP patterns such as splitter, multicast, will create a new unit of work boundary for the messages in their sub-route (eg the split message); however these EIPs have an option named shareUnitOfWork which allows to combine with the parent unit of work in regard to error handling and therefore use the parent original message.

        By default this feature is off.

        Returns:
        the builder
        See Also:
        useOriginalMessage()
      • deadLetterHandleNewException

        public LegacyDefaultErrorHandlerBuilder deadLetterHandleNewException​(boolean handleNewException)
        Deprecated.
        Whether the dead letter channel should handle (and ignore) any new exception that may been thrown during sending the message to the dead letter endpoint.

        The default value is true which means any such kind of exception is handled and ignored. Set this to false to let the exception be propagated back on the Exchange. This can be used in situations where you use transactions, and want to use Camel's dead letter channel to deal with exceptions during routing, but if the dead letter channel itself fails because of a new exception being thrown, then by setting this to false the new exceptions is propagated back and set on the Exchange, which allows the transaction to detect the exception, and rollback.

        Parameters:
        handleNewException - true to handle (and ignore), false to catch and propagated the exception on the Exchange
        Returns:
        the builder
      • onPrepareFailure

        public LegacyDefaultErrorHandlerBuilder onPrepareFailure​(org.apache.camel.Processor processor)
        Deprecated.
        Sets a custom Processor to prepare the Exchange before handled by the failure processor / dead letter channel. This allows for example to enrich the message before sending to a dead letter queue.
        Parameters:
        processor - the processor
        Returns:
        the builder
      • onPrepareFailureRef

        public LegacyDefaultErrorHandlerBuilder onPrepareFailureRef​(String onPrepareFailureRef)
        Deprecated.
        Sets a reference for the processor to use before handled by the failure processor.
        Parameters:
        onPrepareFailureRef - the processor's reference
        Returns:
        the builder
        See Also:
        onPrepareFailure(Processor)
      • onExceptionOccurred

        public LegacyDefaultErrorHandlerBuilder onExceptionOccurred​(org.apache.camel.Processor processor)
        Deprecated.
        Sets a custom Processor to process the Exchange just after an exception was thrown. This allows to execute the processor at the same time the exception was thrown.

        Important: Any exception thrown from this processor will be ignored.

        Parameters:
        processor - the processor
        Returns:
        the builder
      • setRedeliveryPolicy

        public void setRedeliveryPolicy​(org.apache.camel.processor.errorhandler.RedeliveryPolicy redeliveryPolicy)
        Deprecated.
        Sets the redelivery policy
        Specified by:
        setRedeliveryPolicy in interface DefaultErrorHandlerProperties
      • getRetryWhilePolicy

        public org.apache.camel.Predicate getRetryWhilePolicy​(org.apache.camel.CamelContext context)
        Deprecated.
      • createRedeliveryPolicy

        protected org.apache.camel.processor.errorhandler.RedeliveryPolicy createRedeliveryPolicy()
        Deprecated.
      • createLogger

        protected org.apache.camel.spi.CamelLogger createLogger()
        Deprecated.