Class HeaderEnricherSpec
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,reactor.util.function.Tuple2<F,H>>
org.springframework.integration.dsl.EndpointSpec<S,ConsumerEndpointFactoryBean,H>
org.springframework.integration.dsl.ConsumerEndpointSpec<HeaderEnricherSpec,MessageTransformingHandler>
org.springframework.integration.dsl.HeaderEnricherSpec
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,MessageTransformingHandler>>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,MessageTransformingHandler>
An
IntegrationComponentSpec
for a HeaderEnricher
.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
-
Field Summary
Fields Modifier and Type Field Description protected HeaderEnricher
headerEnricher
protected Map<String,HeaderValueMessageProcessor<?>>
headerToAdd
Fields inherited from class org.springframework.integration.dsl.EndpointSpec
componentsToRegister, endpointFactoryBean, handler
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target
-
Constructor Summary
Constructors Modifier Constructor Description protected
HeaderEnricherSpec()
-
Method Summary
Modifier and Type Method Description HeaderEnricherSpec
correlationId(Object correlationId)
Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header.HeaderEnricherSpec
correlationId(Object correlationId, Boolean overwrite)
Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header.HeaderEnricherSpec
correlationIdExpression(String correlationIdExpression)
Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is a SpELExpression
evaluation result.HeaderEnricherSpec
correlationIdExpression(String correlationIdExpression, Boolean overwrite)
Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is a SpELExpression
evaluation result.<P> HeaderEnricherSpec
correlationIdFunction(Function<Message<P>,?> correlationIdFunction, Boolean overwrite)
Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is obtained by invoking theFunction
callback.<P> HeaderEnricherSpec
correlationIdFunction(Function<Message<P>,Object> correlationIdFunction)
Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is obtained by invoking theFunction
callback.HeaderEnricherSpec
defaultOverwrite(boolean defaultOverwrite)
Determine the default action to take when setting individual header specifications without an explicit 'overwrite' argument.protected reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,MessageTransformingHandler>
doGet()
HeaderEnricherSpec
errorChannel(Object errorChannel)
Add aMessageHeaders.ERROR_CHANNEL
header: bean name or instance.HeaderEnricherSpec
errorChannel(Object errorChannel, Boolean overwrite)
Add aMessageHeaders.ERROR_CHANNEL
header: bean name or instance.HeaderEnricherSpec
errorChannelExpression(String errorChannelExpression)
Add aMessageHeaders.ERROR_CHANNEL
header where the value is a SpELExpression
evaluation result.HeaderEnricherSpec
errorChannelExpression(String errorChannelExpression, Boolean overwrite)
Add aMessageHeaders.ERROR_CHANNEL
header where the value is a SpELExpression
evaluation result.<P> HeaderEnricherSpec
errorChannelFunction(Function<Message<P>,?> errorChannelFunction, Boolean overwrite)
Add aMessageHeaders.ERROR_CHANNEL
header where the value is obtained by invoking theFunction
callback.<P> HeaderEnricherSpec
errorChannelFunction(Function<Message<P>,Object> errorChannelFunction)
Add aMessageHeaders.ERROR_CHANNEL
header where the value is obtained by invoking theFunction
callback.HeaderEnricherSpec
expirationDate(Object expirationDate)
HeaderEnricherSpec
expirationDate(Object expirationDate, Boolean overwrite)
Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header.HeaderEnricherSpec
expirationDateExpression(String expirationDateExpression)
Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is a SpELExpression
evaluation result.HeaderEnricherSpec
expirationDateExpression(String expirationDateExpression, Boolean overwrite)
Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is a SpELExpression
evaluation result.<P> HeaderEnricherSpec
expirationDateFunction(Function<Message<P>,?> expirationDateFunction, Boolean overwrite)
Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is obtained by invoking theFunction
callback.<P> HeaderEnricherSpec
expirationDateFunction(Function<Message<P>,Object> expirationDateFunction)
Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is obtained by invoking theFunction
callback.<V> HeaderEnricherSpec
header(String headerName, HeaderValueMessageProcessor<V> headerValueMessageProcessor)
Add a single header specification where the value is obtained by calling theHeaderValueMessageProcessor
.<V> HeaderEnricherSpec
header(String name, V value)
Add a single header specification.<V> HeaderEnricherSpec
header(String name, V value, Boolean overwrite)
Add a single header specification.HeaderEnricherSpec
headerChannelsToString()
Add header specifications to automatically convert header channels (reply, error channels) to Strings and store them in a header channel registry.HeaderEnricherSpec
headerChannelsToString(String timeToLiveExpression)
Add header specifications to automatically convert header channels (reply, error channels) to Strings and store them in a header channel registry.HeaderEnricherSpec
headerExpression(String name, String expression)
Add a single header specification where the value is a String representation of a SpELExpression
.HeaderEnricherSpec
headerExpression(String name, String expression, Boolean overwrite)
Add a single header specification where the value is a String representation of a SpELExpression
.HeaderEnricherSpec
headerExpressions(Consumer<StringStringMapBuilder> configurer)
Add header specifications via the consumer callback, which receives aStringStringMapBuilder
; theMap
values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched.HeaderEnricherSpec
headerExpressions(Consumer<StringStringMapBuilder> configurer, Boolean overwrite)
Add header specifications via the consumer callback, which receives aStringStringMapBuilder
; theMap
values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched.HeaderEnricherSpec
headerExpressions(Map<String,String> headers)
Add header specifications; theMap
values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched.HeaderEnricherSpec
headerExpressions(Map<String,String> headers, Boolean overwrite)
Add header specifications; theMap
values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched.HeaderEnricherSpec
headerExpressions(MapBuilder<?,String,String> headers)
Add header specifications from theMapBuilder
; theMap
values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched.HeaderEnricherSpec
headerExpressions(MapBuilder<?,String,String> headers, Boolean overwrite)
Add header specifications from theMapBuilder
; theMap
values must be String representations of SpEL expressions that will be evaluated at run time when the message headers are enriched.<P> HeaderEnricherSpec
headerFunction(String name, Function<Message<P>,?> function)
Add a single header specification where the value is obtained by invoking theFunction
callback.<P> HeaderEnricherSpec
headerFunction(String name, Function<Message<P>,?> function, Boolean overwrite)
Add a single header specification where the value is obtained by invoking theFunction
callback.HeaderEnricherSpec
headers(Map<String,Object> headers)
Add header specifications from theMap
; if a map value is anExpression
, it will be evaluated at run time when the message headers are enriched.HeaderEnricherSpec
headers(Map<String,Object> headers, Boolean overwrite)
Add header specifications from theMap
; if a map value is anExpression
, it will be evaluated at run time when the message headers are enriched.HeaderEnricherSpec
headers(MapBuilder<?,String,Object> headers)
Add header specifications from theMapBuilder
; if a map value is anExpression
, it will be evaluated at run time when the message headers are enriched.HeaderEnricherSpec
headers(MapBuilder<?,String,Object> headers, Boolean overwrite)
Add header specifications from theMapBuilder
; if a map value is anExpression
, it will be evaluated at run time when the message headers are enriched.HeaderEnricherSpec
messageProcessor(String expression)
Configure anExpressionEvaluatingMessageProcessor
that evaluates to aMap
of additional headers.HeaderEnricherSpec
messageProcessor(String beanName, String methodName)
Configure anMethodInvokingMessageProcessor
that invokes the method on the bean - the method must return aMap
of headers.HeaderEnricherSpec
messageProcessor(MessageProcessor<?> messageProcessor)
Configure an optional customMessageProcessor
for the enricher.HeaderEnricherSpec
priority(Number priority)
Add aIntegrationMessageHeaderAccessor.PRIORITY
header.HeaderEnricherSpec
priority(Number priority, Boolean overwrite)
Add aIntegrationMessageHeaderAccessor.PRIORITY
header.HeaderEnricherSpec
priorityExpression(String priorityExpression)
Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is a SpELExpression
evaluation result.HeaderEnricherSpec
priorityExpression(String priorityExpression, Boolean overwrite)
Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is a SpELExpression
evaluation result.<P> HeaderEnricherSpec
priorityFunction(Function<Message<P>,?> priorityFunction, Boolean overwrite)
Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is obtained by invoking theFunction
callback.<P> HeaderEnricherSpec
priorityFunction(Function<Message<P>,Object> priorityFunction)
Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is obtained by invoking theFunction
callback.HeaderEnricherSpec
replyChannel(Object replyChannel)
Add aMessageHeaders.REPLY_CHANNEL
header: bean name or instance.HeaderEnricherSpec
replyChannel(Object replyChannel, Boolean overwrite)
Add aMessageHeaders.REPLY_CHANNEL
header: bean name or instance.HeaderEnricherSpec
replyChannelExpression(String replyChannelExpression)
Add aMessageHeaders.REPLY_CHANNEL
header where the value is a SpELExpression
evaluation result.HeaderEnricherSpec
replyChannelExpression(String replyChannelExpression, Boolean overwrite)
Add aMessageHeaders.REPLY_CHANNEL
header where the value is a SpELExpression
evaluation result.<P> HeaderEnricherSpec
replyChannelFunction(Function<Message<P>,?> replyChannelFunction, Boolean overwrite)
Add aMessageHeaders.REPLY_CHANNEL
header where the value is obtained by invoking theFunction
callback.<P> HeaderEnricherSpec
replyChannelFunction(Function<Message<P>,Object> replyChannelFunction)
Add aMessageHeaders.REPLY_CHANNEL
header where the value is obtained by invoking theFunction
callback.HeaderEnricherSpec
routingSlip(Boolean overwrite, Object... routingSlipPath)
Add aIntegrationMessageHeaderAccessor.ROUTING_SLIP
header.HeaderEnricherSpec
routingSlip(Object... routingSlipPath)
Add aIntegrationMessageHeaderAccessor.ROUTING_SLIP
header.HeaderEnricherSpec
shouldSkipNulls(boolean shouldSkipNulls)
Methods inherited from class org.springframework.integration.dsl.ConsumerEndpointSpec
advice, async, autoStartup, customizeMonoReply, handleMessageAdvice, notPropagatedHeaders, order, phase, poller, reactive, reactive, requiresReply, role, sendTimeout, taskScheduler, transactional, transactional, transactional, transactional, transactional
Methods inherited from class org.springframework.integration.dsl.EndpointSpec
assertHandler, getComponentsToRegister, id, obtainInputChannelFromFlow, obtainInputChannelFromFlow, poller, poller
Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Field Details
-
Constructor Details
-
HeaderEnricherSpec
protected HeaderEnricherSpec()
-
-
Method Details
-
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
- Parameters:
shouldSkipNulls
- the shouldSkipNulls.- Returns:
- the header enricher spec.
- See Also:
HeaderEnricher.setShouldSkipNulls(boolean)
-
messageProcessor
Configure an optional customMessageProcessor
for the enricher. The processor must return aMap
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
Configure anExpressionEvaluatingMessageProcessor
that evaluates to aMap
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
Configure anMethodInvokingMessageProcessor
that invokes the method on the bean - the method must return aMap
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
Add header specifications from theMapBuilder
; if a map value is anExpression
, 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, unlessdefaultOverwrite(boolean)
is true.- Parameters:
headers
- the header map builder.- Returns:
- the header enricher spec.
-
headers
Add header specifications from theMapBuilder
; if a map value is anExpression
, 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
Add header specifications from theMap
; if a map value is anExpression
, 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, unlessdefaultOverwrite(boolean)
is true.- Parameters:
headers
- The header builder.- Returns:
- the header enricher spec.
-
headers
Add header specifications from theMap
; if a map value is anExpression
, 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
Add header specifications from theMapBuilder
; theMap
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, unlessdefaultOverwrite(boolean)
is true.- Parameters:
headers
- the header map builder.- Returns:
- the header enricher spec.
-
headerExpressions
public HeaderEnricherSpec headerExpressions(MapBuilder<?,String,String> headers, Boolean overwrite)Add header specifications from theMapBuilder
; theMap
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
Add header specifications via the consumer callback, which receives aStringStringMapBuilder
; theMap
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, unlessdefaultOverwrite(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(Consumer<StringStringMapBuilder> configurer, Boolean overwrite)Add header specifications via the consumer callback, which receives aStringStringMapBuilder
; theMap
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
Add header specifications; theMap
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, unlessdefaultOverwrite(boolean)
is true.- Parameters:
headers
- the headers.- Returns:
- the header enricher spec.
-
headerExpressions
Add header specifications; theMap
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
Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
correlationId
- the header value forIntegrationMessageHeaderAccessor.CORRELATION_ID
.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
correlationId
Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header.- Parameters:
correlationId
- the header value forIntegrationMessageHeaderAccessor.CORRELATION_ID
.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
correlationIdExpression
Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is a SpELExpression
evaluation result. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
correlationIdExpression
- the expression forIntegrationMessageHeaderAccessor.CORRELATION_ID
header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
correlationIdExpression
public HeaderEnricherSpec correlationIdExpression(String correlationIdExpression, Boolean overwrite)Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is a SpELExpression
evaluation result.- Parameters:
correlationIdExpression
- the expression forIntegrationMessageHeaderAccessor.CORRELATION_ID
header.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
correlationIdFunction
public <P> HeaderEnricherSpec correlationIdFunction(Function<Message<P>,Object> correlationIdFunction)Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is obtained by invoking theFunction
callback. If the header exists, it will not be overwritten unlessdefaultOverwrite(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(Function<Message<P>,?> correlationIdFunction, Boolean overwrite)Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is obtained by invoking theFunction
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
Add aMessageHeaders.REPLY_CHANNEL
header: bean name or instance. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
replyChannel
- the header value forMessageHeaders.REPLY_CHANNEL
.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
replyChannel
Add aMessageHeaders.REPLY_CHANNEL
header: bean name or instance.- Parameters:
replyChannel
- the header value forMessageHeaders.REPLY_CHANNEL
.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
replyChannelExpression
Add aMessageHeaders.REPLY_CHANNEL
header where the value is a SpELExpression
evaluation result. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
replyChannelExpression
- the expression forMessageHeaders.REPLY_CHANNEL
header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
replyChannelExpression
Add aMessageHeaders.REPLY_CHANNEL
header where the value is a SpELExpression
evaluation result.- Parameters:
replyChannelExpression
- the expression forMessageHeaders.REPLY_CHANNEL
header.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
replyChannelFunction
public <P> HeaderEnricherSpec replyChannelFunction(Function<Message<P>,Object> replyChannelFunction)Add aMessageHeaders.REPLY_CHANNEL
header where the value is obtained by invoking theFunction
callback. If the header exists, it will not be overwritten unlessdefaultOverwrite(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(Function<Message<P>,?> replyChannelFunction, Boolean overwrite)Add aMessageHeaders.REPLY_CHANNEL
header where the value is obtained by invoking theFunction
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
Add aMessageHeaders.ERROR_CHANNEL
header: bean name or instance. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
errorChannel
- the header value forMessageHeaders.ERROR_CHANNEL
.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
errorChannel
Add aMessageHeaders.ERROR_CHANNEL
header: bean name or instance.- Parameters:
errorChannel
- the header value forMessageHeaders.ERROR_CHANNEL
.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
errorChannelExpression
Add aMessageHeaders.ERROR_CHANNEL
header where the value is a SpELExpression
evaluation result. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
errorChannelExpression
- the expression forMessageHeaders.ERROR_CHANNEL
header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
errorChannelExpression
Add aMessageHeaders.ERROR_CHANNEL
header where the value is a SpELExpression
evaluation result.- Parameters:
errorChannelExpression
- the expression forMessageHeaders.ERROR_CHANNEL
header.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
errorChannelFunction
public <P> HeaderEnricherSpec errorChannelFunction(Function<Message<P>,Object> errorChannelFunction)Add aMessageHeaders.ERROR_CHANNEL
header where the value is obtained by invoking theFunction
callback. If the header exists, it will not be overwritten unlessdefaultOverwrite(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(Function<Message<P>,?> errorChannelFunction, Boolean overwrite)Add aMessageHeaders.ERROR_CHANNEL
header where the value is obtained by invoking theFunction
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
Add aIntegrationMessageHeaderAccessor.PRIORITY
header. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
priority
- the header value forIntegrationMessageHeaderAccessor.PRIORITY
.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
priority
Add aIntegrationMessageHeaderAccessor.PRIORITY
header.- Parameters:
priority
- the header value forIntegrationMessageHeaderAccessor.PRIORITY
.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
priorityExpression
Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is a SpELExpression
evaluation result. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
priorityExpression
- the expression forIntegrationMessageHeaderAccessor.PRIORITY
header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
priorityExpression
Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is a SpELExpression
evaluation result.- Parameters:
priorityExpression
- the expression forIntegrationMessageHeaderAccessor.PRIORITY
header.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
priorityFunction
Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is obtained by invoking theFunction
callback. If the header exists, it will not be overwritten unlessdefaultOverwrite(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(Function<Message<P>,?> priorityFunction, Boolean overwrite)Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is obtained by invoking theFunction
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
Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header:Date
orlong
. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
expirationDate
- the header value forIntegrationMessageHeaderAccessor.EXPIRATION_DATE
.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
expirationDate
Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header.- Parameters:
expirationDate
- the header value forIntegrationMessageHeaderAccessor.EXPIRATION_DATE
.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
expirationDateExpression
Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is a SpELExpression
evaluation result. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
expirationDateExpression
- the expression forIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
expirationDateExpression
public HeaderEnricherSpec expirationDateExpression(String expirationDateExpression, Boolean overwrite)Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is a SpELExpression
evaluation result.- Parameters:
expirationDateExpression
- the expression forIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
- Since:
- 5.2
-
expirationDateFunction
public <P> HeaderEnricherSpec expirationDateFunction(Function<Message<P>,Object> expirationDateFunction)Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is obtained by invoking theFunction
callback. If the header exists, it will not be overwritten unlessdefaultOverwrite(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(Function<Message<P>,?> expirationDateFunction, Boolean overwrite)Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is obtained by invoking theFunction
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
Add aIntegrationMessageHeaderAccessor.ROUTING_SLIP
header. The possible values are:- A
MessageChannel
instance. - A
MessageChannel
bean name. - A
RoutingSlipRouteStrategy
instance. - A
RoutingSlipRouteStrategy
bean name. - A
String
for SpEL expression which has to be evaluated to theMessageChannel
orRoutingSlipRouteStrategy
.
defaultOverwrite(boolean)
is true.- Parameters:
routingSlipPath
- the header value forIntegrationMessageHeaderAccessor.ROUTING_SLIP
.- Returns:
- the header enricher spec.
- Since:
- 5.2
- A
-
routingSlip
Add aIntegrationMessageHeaderAccessor.ROUTING_SLIP
header. The possible values are:- A
MessageChannel
instance. - A
MessageChannel
bean name. - A
RoutingSlipRouteStrategy
instance. - A
RoutingSlipRouteStrategy
bean name. - A
String
for SpEL expression which has to be evaluated to theMessageChannel
orRoutingSlipRouteStrategy
.
- Parameters:
overwrite
- true to overwrite an existing header.routingSlipPath
- the header value forIntegrationMessageHeaderAccessor.ROUTING_SLIP
.- Returns:
- the header enricher spec.
- Since:
- 5.2
- A
-
header
Add a single header specification. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Type Parameters:
V
- the value type.- Parameters:
name
- the header name.value
- the header value (not anExpression
).- Returns:
- the header enricher spec.
-
header
Add a single header specification.- Type Parameters:
V
- the value type.- Parameters:
name
- the header name.value
- the header value (not anExpression
).overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
-
headerExpression
Add a single header specification where the value is a String representation of a SpELExpression
. If the header exists, it will not be overwritten unlessdefaultOverwrite(boolean)
is true.- Parameters:
name
- the header name.expression
- the expression.- Returns:
- the header enricher spec.
-
headerExpression
Add a single header specification where the value is a String representation of a SpELExpression
.- Parameters:
name
- the header name.expression
- the expression.overwrite
- true to overwrite an existing header.- Returns:
- the header enricher spec.
-
headerFunction
Add a single header specification where the value is obtained by invoking theFunction
callback. If the header exists, it will not be overwritten unlessdefaultOverwrite(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(String name, Function<Message<P>,?> function, Boolean overwrite)Add a single header specification where the value is obtained by invoking theFunction
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(String headerName, HeaderValueMessageProcessor<V> headerValueMessageProcessor)Add a single header specification where the value is obtained by calling theHeaderValueMessageProcessor
.- Type Parameters:
V
- the value type.- Parameters:
headerName
- the header name.headerValueMessageProcessor
- the message processor.- Returns:
- the header enricher spec.
-
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
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 classConsumerEndpointSpec<HeaderEnricherSpec,MessageTransformingHandler>
-