Class HeaderEnricherSpec

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,​MessageTransformingHandler>>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, ComponentsRegistration

public class HeaderEnricherSpec
extends ConsumerEndpointSpec<HeaderEnricherSpec,​MessageTransformingHandler>
Since:
5.0
  • Field Details

  • Constructor Details

  • Method Details

    • defaultOverwrite

      public HeaderEnricherSpec defaultOverwrite​(boolean defaultOverwrite)
      Determine the default action to take when setting individual header specifications without an explicit 'overwrite' argument.
      Parameters:
      defaultOverwrite - the defaultOverwrite.
      Returns:
      the header enricher spec.
      See Also:
      HeaderEnricher.setDefaultOverwrite(boolean)
    • shouldSkipNulls

      public HeaderEnricherSpec shouldSkipNulls​(boolean shouldSkipNulls)
      Parameters:
      shouldSkipNulls - the shouldSkipNulls.
      Returns:
      the header enricher spec.
      See Also:
      HeaderEnricher.setShouldSkipNulls(boolean)
    • messageProcessor

      public HeaderEnricherSpec messageProcessor​(MessageProcessor<?> messageProcessor)
      Configure an optional custom MessageProcessor for the enricher. The processor must return a Map of header names and values. They will be added to the inbound message headers before evaluating the individual configured header specifications.
      Parameters:
      messageProcessor - the messageProcessor.
      Returns:
      the header enricher spec.
      See Also:
      HeaderEnricher.setMessageProcessor(MessageProcessor)
    • messageProcessor

      public HeaderEnricherSpec messageProcessor​(java.lang.String expression)
      Configure an ExpressionEvaluatingMessageProcessor that evaluates to a Map of additional headers. They will be added to the inbound message headers before evaluating the individual configured header specifications.
      Parameters:
      expression - the expression.
      Returns:
      the header enricher spec.
      See Also:
      messageProcessor(MessageProcessor)
    • messageProcessor

      public HeaderEnricherSpec messageProcessor​(java.lang.String beanName, java.lang.String methodName)
      Configure an MethodInvokingMessageProcessor that invokes the method on the bean - the method must return a Map of headers. They will be added to the inbound message headers before evaluating the individual configured header specifications.
      Parameters:
      beanName - The bean name.
      methodName - The method name.
      Returns:
      the header enricher spec.
      See Also:
      messageProcessor(MessageProcessor)
    • headers

      public HeaderEnricherSpec headers​(MapBuilder<?,​java.lang.String,​java.lang.Object> headers)
      Add header specifications from the MapBuilder; if a map value is an Expression, it will be evaluated at run time when the message headers are enriched. Otherwise the value is simply added to the headers. Headers derived from the map will not overwrite existing headers, unless defaultOverwrite(boolean) is true.
      Parameters:
      headers - the header map builder.
      Returns:
      the header enricher spec.
    • headers

      public HeaderEnricherSpec headers​(MapBuilder<?,​java.lang.String,​java.lang.Object> headers, java.lang.Boolean overwrite)
      Add header specifications from the MapBuilder; if a map value is an Expression, it will be evaluated at run time when the message headers are enriched. Otherwise the value is simply added to the headers.
      Parameters:
      headers - the header map builder.
      overwrite - true to overwrite existing headers.
      Returns:
      the header enricher spec.
    • headers

      public HeaderEnricherSpec headers​(java.util.Map<java.lang.String,​java.lang.Object> headers)
      Add header specifications from the Map; if a map value is an Expression, it will be evaluated at run time when the message headers are enriched. Otherwise the value is simply added to the headers. Headers derived from the map will not overwrite existing headers, unless defaultOverwrite(boolean) is true.
      Parameters:
      headers - The header builder.
      Returns:
      the header enricher spec.
    • headers

      public HeaderEnricherSpec headers​(java.util.Map<java.lang.String,​java.lang.Object> headers, java.lang.Boolean overwrite)
      Add header specifications from the Map; if a map value is an Expression, it will be evaluated at run time when the message headers are enriched. Otherwise the value is simply added to the headers.
      Parameters:
      headers - The header builder.
      overwrite - true to overwrite existing headers.
      Returns:
      the header enricher spec.
    • headerExpressions

      public HeaderEnricherSpec headerExpressions​(MapBuilder<?,​java.lang.String,​java.lang.String> headers)
      Add header specifications from the MapBuilder; the Map values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched. Headers derived from the map will not overwrite existing headers, unless defaultOverwrite(boolean) is true.
      Parameters:
      headers - the header map builder.
      Returns:
      the header enricher spec.
    • headerExpressions

      public HeaderEnricherSpec headerExpressions​(MapBuilder<?,​java.lang.String,​java.lang.String> headers, java.lang.Boolean overwrite)
      Add header specifications from the MapBuilder; the Map values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched.
      Parameters:
      headers - the header map builder.
      overwrite - true to overwrite existing headers.
      Returns:
      the header enricher spec.
    • headerExpressions

      public HeaderEnricherSpec headerExpressions​(java.util.function.Consumer<StringStringMapBuilder> configurer)
      Add header specifications via the consumer callback, which receives a StringStringMapBuilder; the Map values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched. Headers derived from the map will not overwrite existing headers, unless defaultOverwrite(boolean) is true. Usually used with a JDK8 lambda:
       
       .enrichHeaders(s -> s.headerExpressions(c -> c
       			.put(MailHeaders.SUBJECT, "payload.subject")
       			.put(MailHeaders.FROM,    "payload.from[0].toString()")))
       
       
      Parameters:
      configurer - the configurer.
      Returns:
      the header enricher spec.
    • headerExpressions

      public HeaderEnricherSpec headerExpressions​(java.util.function.Consumer<StringStringMapBuilder> configurer, java.lang.Boolean overwrite)
      Add header specifications via the consumer callback, which receives a StringStringMapBuilder; the Map values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched. Usually used with a JDK8 lambda:
       
       .enrichHeaders(s -> s.headerExpressions(c -> c
       			.put(MailHeaders.SUBJECT, "payload.subject")
       			.put(MailHeaders.FROM,    "payload.from[0].toString()"), true))
       
       
      Parameters:
      configurer - the configurer.
      overwrite - true to overwrite existing headers.
      Returns:
      the header enricher spec.
    • headerExpressions

      public HeaderEnricherSpec headerExpressions​(java.util.Map<java.lang.String,​java.lang.String> headers)
      Add header specifications; the Map values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched. Headers derived from the map will not overwrite existing headers, unless defaultOverwrite(boolean) is true.
      Parameters:
      headers - the headers.
      Returns:
      the header enricher spec.
    • headerExpressions

      public HeaderEnricherSpec headerExpressions​(java.util.Map<java.lang.String,​java.lang.String> headers, java.lang.Boolean overwrite)
      Add header specifications; the Map values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched.
      Parameters:
      headers - the headers.
      overwrite - true to overwrite existing headers.
      Returns:
      the header enricher spec.
    • correlationId

      public HeaderEnricherSpec correlationId​(java.lang.Object correlationId)
      Add a IntegrationMessageHeaderAccessor.CORRELATION_ID header. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      correlationId - the header value for IntegrationMessageHeaderAccessor.CORRELATION_ID.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • correlationId

      public HeaderEnricherSpec correlationId​(java.lang.Object correlationId, java.lang.Boolean overwrite)
      Parameters:
      correlationId - the header value for IntegrationMessageHeaderAccessor.CORRELATION_ID.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • correlationIdExpression

      public HeaderEnricherSpec correlationIdExpression​(java.lang.String correlationIdExpression)
      Add a IntegrationMessageHeaderAccessor.CORRELATION_ID header where the value is a SpEL Expression evaluation result. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      correlationIdExpression - the expression for IntegrationMessageHeaderAccessor.CORRELATION_ID header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • correlationIdExpression

      public HeaderEnricherSpec correlationIdExpression​(java.lang.String correlationIdExpression, java.lang.Boolean overwrite)
      Add a IntegrationMessageHeaderAccessor.CORRELATION_ID header where the value is a SpEL Expression evaluation result.
      Parameters:
      correlationIdExpression - the expression for IntegrationMessageHeaderAccessor.CORRELATION_ID header.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • correlationIdFunction

      public <P> HeaderEnricherSpec correlationIdFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​java.lang.Object> correlationIdFunction)
      Add a IntegrationMessageHeaderAccessor.CORRELATION_ID header where the value is obtained by invoking the Function callback. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Type Parameters:
      P - the payload type.
      Parameters:
      correlationIdFunction - the function.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • correlationIdFunction

      public <P> HeaderEnricherSpec correlationIdFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​?> correlationIdFunction, java.lang.Boolean overwrite)
      Add a IntegrationMessageHeaderAccessor.CORRELATION_ID header where the value is obtained by invoking the Function callback.
      Type Parameters:
      P - the payload type.
      Parameters:
      correlationIdFunction - the function.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • replyChannel

      public HeaderEnricherSpec replyChannel​(java.lang.Object replyChannel)
      Add a MessageHeaders.REPLY_CHANNEL header: bean name or instance. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      replyChannel - the header value for MessageHeaders.REPLY_CHANNEL.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • replyChannel

      public HeaderEnricherSpec replyChannel​(java.lang.Object replyChannel, java.lang.Boolean overwrite)
      Add a MessageHeaders.REPLY_CHANNEL header: bean name or instance.
      Parameters:
      replyChannel - the header value for MessageHeaders.REPLY_CHANNEL.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • replyChannelExpression

      public HeaderEnricherSpec replyChannelExpression​(java.lang.String replyChannelExpression)
      Add a MessageHeaders.REPLY_CHANNEL header where the value is a SpEL Expression evaluation result. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      replyChannelExpression - the expression for MessageHeaders.REPLY_CHANNEL header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • replyChannelExpression

      public HeaderEnricherSpec replyChannelExpression​(java.lang.String replyChannelExpression, java.lang.Boolean overwrite)
      Add a MessageHeaders.REPLY_CHANNEL header where the value is a SpEL Expression evaluation result.
      Parameters:
      replyChannelExpression - the expression for MessageHeaders.REPLY_CHANNEL header.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • replyChannelFunction

      public <P> HeaderEnricherSpec replyChannelFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​java.lang.Object> replyChannelFunction)
      Add a MessageHeaders.REPLY_CHANNEL header where the value is obtained by invoking the Function callback. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Type Parameters:
      P - the payload type.
      Parameters:
      replyChannelFunction - the function.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • replyChannelFunction

      public <P> HeaderEnricherSpec replyChannelFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​?> replyChannelFunction, java.lang.Boolean overwrite)
      Add a MessageHeaders.REPLY_CHANNEL header where the value is obtained by invoking the Function callback.
      Type Parameters:
      P - the payload type.
      Parameters:
      replyChannelFunction - the function.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • errorChannel

      public HeaderEnricherSpec errorChannel​(java.lang.Object errorChannel)
      Add a MessageHeaders.ERROR_CHANNEL header: bean name or instance. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      errorChannel - the header value for MessageHeaders.ERROR_CHANNEL.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • errorChannel

      public HeaderEnricherSpec errorChannel​(java.lang.Object errorChannel, java.lang.Boolean overwrite)
      Add a MessageHeaders.ERROR_CHANNEL header: bean name or instance.
      Parameters:
      errorChannel - the header value for MessageHeaders.ERROR_CHANNEL.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • errorChannelExpression

      public HeaderEnricherSpec errorChannelExpression​(java.lang.String errorChannelExpression)
      Add a MessageHeaders.ERROR_CHANNEL header where the value is a SpEL Expression evaluation result. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      errorChannelExpression - the expression for MessageHeaders.ERROR_CHANNEL header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • errorChannelExpression

      public HeaderEnricherSpec errorChannelExpression​(java.lang.String errorChannelExpression, java.lang.Boolean overwrite)
      Add a MessageHeaders.ERROR_CHANNEL header where the value is a SpEL Expression evaluation result.
      Parameters:
      errorChannelExpression - the expression for MessageHeaders.ERROR_CHANNEL header.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • errorChannelFunction

      public <P> HeaderEnricherSpec errorChannelFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​java.lang.Object> errorChannelFunction)
      Add a MessageHeaders.ERROR_CHANNEL header where the value is obtained by invoking the Function callback. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Type Parameters:
      P - the payload type.
      Parameters:
      errorChannelFunction - the function.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • errorChannelFunction

      public <P> HeaderEnricherSpec errorChannelFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​?> errorChannelFunction, java.lang.Boolean overwrite)
      Add a MessageHeaders.ERROR_CHANNEL header where the value is obtained by invoking the Function callback.
      Type Parameters:
      P - the payload type.
      Parameters:
      errorChannelFunction - the function.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • priority

      public HeaderEnricherSpec priority​(java.lang.Number priority)
      Add a IntegrationMessageHeaderAccessor.PRIORITY header. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      priority - the header value for IntegrationMessageHeaderAccessor.PRIORITY.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • priority

      public HeaderEnricherSpec priority​(java.lang.Number priority, java.lang.Boolean overwrite)
      Parameters:
      priority - the header value for IntegrationMessageHeaderAccessor.PRIORITY.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • priorityExpression

      public HeaderEnricherSpec priorityExpression​(java.lang.String priorityExpression)
      Add a IntegrationMessageHeaderAccessor.PRIORITY header where the value is a SpEL Expression evaluation result. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      priorityExpression - the expression for IntegrationMessageHeaderAccessor.PRIORITY header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • priorityExpression

      public HeaderEnricherSpec priorityExpression​(java.lang.String priorityExpression, java.lang.Boolean overwrite)
      Add a IntegrationMessageHeaderAccessor.PRIORITY header where the value is a SpEL Expression evaluation result.
      Parameters:
      priorityExpression - the expression for IntegrationMessageHeaderAccessor.PRIORITY header.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • priorityFunction

      public <P> HeaderEnricherSpec priorityFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​java.lang.Object> priorityFunction)
      Add a IntegrationMessageHeaderAccessor.PRIORITY header where the value is obtained by invoking the Function callback. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Type Parameters:
      P - the payload type.
      Parameters:
      priorityFunction - the function.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • priorityFunction

      public <P> HeaderEnricherSpec priorityFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​?> priorityFunction, java.lang.Boolean overwrite)
      Add a IntegrationMessageHeaderAccessor.PRIORITY header where the value is obtained by invoking the Function callback.
      Type Parameters:
      P - the payload type.
      Parameters:
      priorityFunction - the function.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • expirationDate

      public HeaderEnricherSpec expirationDate​(java.lang.Object expirationDate)
      Add a IntegrationMessageHeaderAccessor.EXPIRATION_DATE header: Date or long. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      expirationDate - the header value for IntegrationMessageHeaderAccessor.EXPIRATION_DATE.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • expirationDate

      public HeaderEnricherSpec expirationDate​(java.lang.Object expirationDate, java.lang.Boolean overwrite)
      Parameters:
      expirationDate - the header value for IntegrationMessageHeaderAccessor.EXPIRATION_DATE.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • expirationDateExpression

      public HeaderEnricherSpec expirationDateExpression​(java.lang.String expirationDateExpression)
      Add a IntegrationMessageHeaderAccessor.EXPIRATION_DATE header where the value is a SpEL Expression evaluation result. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      expirationDateExpression - the expression for IntegrationMessageHeaderAccessor.EXPIRATION_DATE header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • expirationDateExpression

      public HeaderEnricherSpec expirationDateExpression​(java.lang.String expirationDateExpression, java.lang.Boolean overwrite)
      Add a IntegrationMessageHeaderAccessor.EXPIRATION_DATE header where the value is a SpEL Expression evaluation result.
      Parameters:
      expirationDateExpression - the expression for IntegrationMessageHeaderAccessor.EXPIRATION_DATE header.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • expirationDateFunction

      public <P> HeaderEnricherSpec expirationDateFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​java.lang.Object> expirationDateFunction)
      Add a IntegrationMessageHeaderAccessor.EXPIRATION_DATE header where the value is obtained by invoking the Function callback. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Type Parameters:
      P - the payload type.
      Parameters:
      expirationDateFunction - the function.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • expirationDateFunction

      public <P> HeaderEnricherSpec expirationDateFunction​(java.util.function.Function<org.springframework.messaging.Message<P>,​?> expirationDateFunction, java.lang.Boolean overwrite)
      Add a IntegrationMessageHeaderAccessor.EXPIRATION_DATE header where the value is obtained by invoking the Function callback.
      Type Parameters:
      P - the payload type.
      Parameters:
      expirationDateFunction - the function.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      Since:
      5.2
      See Also:
      FunctionExpression
    • routingSlip

      public HeaderEnricherSpec routingSlip​(java.lang.Object... routingSlipPath)
      Add a IntegrationMessageHeaderAccessor.ROUTING_SLIP header. The possible values are: If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      routingSlipPath - the header value for IntegrationMessageHeaderAccessor.ROUTING_SLIP.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • routingSlip

      public HeaderEnricherSpec routingSlip​(java.lang.Boolean overwrite, java.lang.Object... routingSlipPath)
      Add a IntegrationMessageHeaderAccessor.ROUTING_SLIP header. The possible values are:
      Parameters:
      overwrite - true to overwrite an existing header.
      routingSlipPath - the header value for IntegrationMessageHeaderAccessor.ROUTING_SLIP.
      Returns:
      the header enricher spec.
      Since:
      5.2
    • header

      public <V> HeaderEnricherSpec header​(java.lang.String name, V value)
      Add a single header specification. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Type Parameters:
      V - the value type.
      Parameters:
      name - the header name.
      value - the header value (not an Expression).
      Returns:
      the header enricher spec.
    • header

      public <V> HeaderEnricherSpec header​(java.lang.String name, V value, java.lang.Boolean overwrite)
      Add a single header specification.
      Type Parameters:
      V - the value type.
      Parameters:
      name - the header name.
      value - the header value (not an Expression).
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
    • headerExpression

      public HeaderEnricherSpec headerExpression​(java.lang.String name, java.lang.String expression)
      Add a single header specification where the value is a String representation of a SpEL Expression. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Parameters:
      name - the header name.
      expression - the expression.
      Returns:
      the header enricher spec.
    • headerExpression

      public HeaderEnricherSpec headerExpression​(java.lang.String name, java.lang.String expression, java.lang.Boolean overwrite)
      Add a single header specification where the value is a String representation of a SpEL Expression.
      Parameters:
      name - the header name.
      expression - the expression.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
    • headerFunction

      public <P> HeaderEnricherSpec headerFunction​(java.lang.String name, java.util.function.Function<org.springframework.messaging.Message<P>,​?> function)
      Add a single header specification where the value is obtained by invoking the Function callback. If the header exists, it will not be overwritten unless defaultOverwrite(boolean) is true.
      Type Parameters:
      P - the payload type.
      Parameters:
      name - the header name.
      function - the function.
      Returns:
      the header enricher spec.
      See Also:
      FunctionExpression
    • headerFunction

      public <P> HeaderEnricherSpec headerFunction​(java.lang.String name, java.util.function.Function<org.springframework.messaging.Message<P>,​?> function, java.lang.Boolean overwrite)
      Add a single header specification where the value is obtained by invoking the Function callback.
      Type Parameters:
      P - the payload type.
      Parameters:
      name - the header name.
      function - the function.
      overwrite - true to overwrite an existing header.
      Returns:
      the header enricher spec.
      See Also:
      FunctionExpression
    • header

      public <V> HeaderEnricherSpec header​(java.lang.String headerName, HeaderValueMessageProcessor<V> headerValueMessageProcessor)
      Add a single header specification where the value is obtained by calling the HeaderValueMessageProcessor.
      Type Parameters:
      V - the value type.
      Parameters:
      headerName - the header name.
      headerValueMessageProcessor - the message processor.
      Returns:
      the header enricher spec.
    • headerChannelsToString

      public HeaderEnricherSpec headerChannelsToString()
      Add header specifications to automatically convert header channels (reply, error channels) to Strings and store them in a header channel registry. Allows persistence and serialization of messages without losing these important framework headers.
      Returns:
      the header enricher spec.
      See Also:
      HeaderChannelRegistry
    • headerChannelsToString

      public HeaderEnricherSpec headerChannelsToString​(java.lang.String timeToLiveExpression)
      Add header specifications to automatically convert header channels (reply, error channels) to Strings and store them in a header channel registry. Allows persistence and serialization of messages without losing these important framework headers.
      Parameters:
      timeToLiveExpression - the minimum time that the mapping will remain in the registry.
      Returns:
      the header enricher spec.
      See Also:
      HeaderChannelRegistry
    • doGet

      protected reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,​MessageTransformingHandler> doGet()
      Overrides:
      doGet in class ConsumerEndpointSpec<HeaderEnricherSpec,​MessageTransformingHandler>