Class FilterEndpointSpec

All Implemented Interfaces:
DisposableBean, FactoryBean<reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,MessageFilter>>, InitializingBean, Lifecycle, Phased, SmartLifecycle, ComponentsRegistration

public class FilterEndpointSpec extends ConsumerEndpointSpec<FilterEndpointSpec,MessageFilter>
A ConsumerEndpointSpec implementation for the MessageFilter.
Since:
5.0
Author:
Artem Bilan
  • Constructor Details

    • FilterEndpointSpec

      protected FilterEndpointSpec(MessageFilter messageFilter)
  • Method Details

    • throwExceptionOnRejection

      public FilterEndpointSpec throwExceptionOnRejection(boolean throwExceptionOnRejection)
      The default value is false meaning that rejected Messages will be quietly dropped or sent to the discard channel if available. Typically this value would not be true when a discard channel is provided, but if so, it will still apply (in such a case, the Message will be sent to the discard channel, and then the exception will be thrown).
      Parameters:
      throwExceptionOnRejection - the throwExceptionOnRejection.
      Returns:
      the endpoint spec.
      See Also:
    • discardChannel

      public FilterEndpointSpec discardChannel(MessageChannel discardChannel)
      Specify a channel where rejected Messages should be sent. If the discard channel is null (the default), rejected Messages will be dropped. However, the 'throwExceptionOnRejection' flag determines whether rejected Messages trigger an exception. That value is evaluated regardless of the presence of a discard channel.
      Parameters:
      discardChannel - the discardChannel.
      Returns:
      the endpoint spec.
      See Also:
    • discardChannel

      public FilterEndpointSpec discardChannel(String discardChannelName)
      Specify a channel name where rejected Messages should be sent. If the discard channel is null (the default), rejected Messages will be dropped. However, the 'throwExceptionOnRejection' flag determines whether rejected Messages trigger an exception. That value is evaluated regardless of the presence of a discard channel.
      Parameters:
      discardChannelName - the discardChannelName.
      Returns:
      the endpoint spec.
      See Also:
    • discardFlow

      public FilterEndpointSpec discardFlow(IntegrationFlow discardFlow)
      Configure a subflow to run for discarded messages instead of a discardChannel(MessageChannel).
      Parameters:
      discardFlow - the discard flow.
      Returns:
      the endpoint spec.
    • discardWithinAdvice

      public FilterEndpointSpec discardWithinAdvice(boolean discardWithinAdvice)
      Set to 'true' if you wish the discard processing to occur within any request handler advice applied to this filter. Also applies to throwing an exception on rejection. Default: true.
      Parameters:
      discardWithinAdvice - the discardWithinAdvice.
      Returns:
      the endpoint spec.
      See Also: