Class InterceptSendToEndpointDefinition

  • All Implemented Interfaces:
    org.apache.camel.CamelContextAware, org.apache.camel.LineNumberAware, Block, OutputNode, org.apache.camel.NamedNode, org.apache.camel.spi.HasId, org.apache.camel.spi.IdAware

    @Metadata(label="configuration")
    public class InterceptSendToEndpointDefinition
    extends OutputDefinition<InterceptSendToEndpointDefinition>
    Intercepts messages being sent to an endpoint
    • Constructor Detail

      • InterceptSendToEndpointDefinition

        public InterceptSendToEndpointDefinition()
      • InterceptSendToEndpointDefinition

        public InterceptSendToEndpointDefinition​(String uri)
    • Method Detail

      • isAbstract

        public boolean isAbstract()
        Description copied from class: ProcessorDefinition
        Whether this model is abstract or not.

        An abstract model is something that is used for configuring cross cutting concerns such as error handling, transaction policies, interceptors etc.

        Regular definitions is what is part of the route, such as ToDefinition, WireTapDefinition and the likes.

        Will by default return false to indicate regular definition, so all the abstract definitions must override this method and return true instead.

        This information is used in camel-spring to let Camel work a bit on the model provided by JAXB from the Spring XML file. This is needed to handle those cross cutting concerns properly. The Java DSL does not have this issue as it can work this out directly using the fluent builder methods.

        Overrides:
        isAbstract in class ProcessorDefinition<InterceptSendToEndpointDefinition>
        Returns:
        true for abstract, otherwise false for regular.
      • when

        public InterceptSendToEndpointDefinition when​(@AsPredicate
                                                      org.apache.camel.Predicate predicate)
        Applies this interceptor only if the given predicate is true
        Parameters:
        predicate - the predicate
        Returns:
        the builder
      • skipSendToOriginalEndpoint

        public InterceptSendToEndpointDefinition skipSendToOriginalEndpoint()
        Skip sending the Exchange to the original intended endpoint
        Returns:
        the builder
      • afterUri

        public InterceptSendToEndpointDefinition afterUri​(String uri)
        After sending to the endpoint then send the message to this url which allows to process its result.
        Returns:
        the builder
      • afterPropertiesSet

        public void afterPropertiesSet()
        This method is only for handling some post configuration that is needed since this is an interceptor, and we have to do a bit of magic logic to fixup to handle predicates with or without proceed/stop set as well.
      • getSkipSendToOriginalEndpoint

        public String getSkipSendToOriginalEndpoint()
      • setSkipSendToOriginalEndpoint

        public void setSkipSendToOriginalEndpoint​(String skipSendToOriginalEndpoint)
        If set to true then the message is not sent to the original endpoint. By default (false) the message is both intercepted and then sent to the original endpoint.
      • getUri

        public String getUri()
      • setUri

        public void setUri​(String uri)
        Intercept sending to the uri or uri pattern.
      • getAfterUri

        public String getAfterUri()
      • setAfterUri

        public void setAfterUri​(String afterProcessor)
        After sending to the endpoint then send the message to this uri which allows to process its result.