Class HeaderEnricherSpec
java.lang.Object
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:
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
FieldsModifier and TypeFieldDescriptionprotected final HeaderEnricher
protected final Map<String,
HeaderValueMessageProcessor<?>> Fields inherited from class org.springframework.integration.dsl.ConsumerEndpointSpec
adviceChain
Fields inherited from class org.springframework.integration.dsl.EndpointSpec
componentsToRegister, endpointFactoryBean, handler
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncorrelationId
(Object correlationId) Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header.correlationId
(Object correlationId, Boolean overwrite) Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header.correlationIdExpression
(String correlationIdExpression) Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is a SpELExpression
evaluation result.correlationIdExpression
(String correlationIdExpression, Boolean overwrite) Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is a SpELExpression
evaluation result.correlationIdFunction
(Function<Message<P>, ?> correlationIdFunction, Boolean overwrite) Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is obtained by invoking theFunction
callback.correlationIdFunction
(Function<Message<P>, Object> correlationIdFunction) Add aIntegrationMessageHeaderAccessor.CORRELATION_ID
header where the value is obtained by invoking theFunction
callback.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()
errorChannel
(Object errorChannel) Add aMessageHeaders.ERROR_CHANNEL
header: bean name or instance.errorChannel
(Object errorChannel, Boolean overwrite) Add aMessageHeaders.ERROR_CHANNEL
header: bean name or instance.errorChannelExpression
(String errorChannelExpression) Add aMessageHeaders.ERROR_CHANNEL
header where the value is a SpELExpression
evaluation result.errorChannelExpression
(String errorChannelExpression, Boolean overwrite) Add aMessageHeaders.ERROR_CHANNEL
header where the value is a SpELExpression
evaluation result.errorChannelFunction
(Function<Message<P>, ?> errorChannelFunction, Boolean overwrite) Add aMessageHeaders.ERROR_CHANNEL
header where the value is obtained by invoking theFunction
callback.errorChannelFunction
(Function<Message<P>, Object> errorChannelFunction) Add aMessageHeaders.ERROR_CHANNEL
header where the value is obtained by invoking theFunction
callback.expirationDate
(Object expirationDate) expirationDate
(Object expirationDate, Boolean overwrite) Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header.expirationDateExpression
(String expirationDateExpression) Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is a SpELExpression
evaluation result.expirationDateExpression
(String expirationDateExpression, Boolean overwrite) Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is a SpELExpression
evaluation result.expirationDateFunction
(Function<Message<P>, ?> expirationDateFunction, Boolean overwrite) Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is obtained by invoking theFunction
callback.expirationDateFunction
(Function<Message<P>, Object> expirationDateFunction) Add aIntegrationMessageHeaderAccessor.EXPIRATION_DATE
header where the value is obtained by invoking theFunction
callback.header
(String headerName, HeaderValueMessageProcessor<V> headerValueMessageProcessor) Add a single header specification where the value is obtained by calling theHeaderValueMessageProcessor
.Add a single header specification.Add a single header specification.Add header specifications to automatically convert header channels (reply, error channels) to Strings and store them in a header channel registry.headerChannelsToString
(String timeToLiveExpression) Add header specifications to automatically convert header channels (reply, error channels) to Strings and store them in a header channel registry.headerExpression
(String name, String expression) Add a single header specification where the value is a String representation of a SpELExpression
.headerExpression
(String name, String expression, Boolean overwrite) Add a single header specification where the value is a String representation of a SpELExpression
.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.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.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.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.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.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.headerFunction
(String name, Function<Message<P>, ?> function) Add a single header specification where the value is obtained by invoking theFunction
callback.headerFunction
(String name, Function<Message<P>, ?> function, Boolean overwrite) Add a single header specification where the value is obtained by invoking theFunction
callback.Add header specifications from theMap
; if a map value is anExpression
, it will be evaluated at run time when the message headers are enriched.Add header specifications from theMap
; if a map value is anExpression
, it will be evaluated at run time when the message headers are enriched.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.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.messageProcessor
(String expression) Configure anExpressionEvaluatingMessageProcessor
that evaluates to aMap
of additional headers.messageProcessor
(String beanName, String methodName) Configure anMethodInvokingMessageProcessor
that invokes the method on the bean - the method must return aMap
of headers.messageProcessor
(MessageProcessor<?> messageProcessor) Configure an optional customMessageProcessor
for the enricher.Add aIntegrationMessageHeaderAccessor.PRIORITY
header.Add aIntegrationMessageHeaderAccessor.PRIORITY
header.priorityExpression
(String priorityExpression) Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is a SpELExpression
evaluation result.priorityExpression
(String priorityExpression, Boolean overwrite) Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is a SpELExpression
evaluation result.priorityFunction
(Function<Message<P>, ?> priorityFunction, Boolean overwrite) Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is obtained by invoking theFunction
callback.priorityFunction
(Function<Message<P>, Object> priorityFunction) Add aIntegrationMessageHeaderAccessor.PRIORITY
header where the value is obtained by invoking theFunction
callback.replyChannel
(Object replyChannel) Add aMessageHeaders.REPLY_CHANNEL
header: bean name or instance.replyChannel
(Object replyChannel, Boolean overwrite) Add aMessageHeaders.REPLY_CHANNEL
header: bean name or instance.replyChannelExpression
(String replyChannelExpression) Add aMessageHeaders.REPLY_CHANNEL
header where the value is a SpELExpression
evaluation result.replyChannelExpression
(String replyChannelExpression, Boolean overwrite) Add aMessageHeaders.REPLY_CHANNEL
header where the value is a SpELExpression
evaluation result.replyChannelFunction
(Function<Message<P>, ?> replyChannelFunction, Boolean overwrite) Add aMessageHeaders.REPLY_CHANNEL
header where the value is obtained by invoking theFunction
callback.replyChannelFunction
(Function<Message<P>, Object> replyChannelFunction) Add aMessageHeaders.REPLY_CHANNEL
header where the value is obtained by invoking theFunction
callback.routingSlip
(Boolean overwrite, Object... routingSlipPath) Add aIntegrationMessageHeaderAccessor.ROUTING_SLIP
header.routingSlip
(Object... routingSlipPath) Add aIntegrationMessageHeaderAccessor.ROUTING_SLIP
header.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, afterPropertiesSet, destroy, get, getId, getObject, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Field Details
-
headerToAdd
-
headerEnricher
-
-
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:
-
shouldSkipNulls
- Parameters:
shouldSkipNulls
- the shouldSkipNulls.- Returns:
- the header enricher spec.
- See Also:
-
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:
-
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
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:
-
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, @Nullable 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, @Nullable 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
public HeaderEnricherSpec headerExpressions(Map<String, String> headers, @Nullable 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.- 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, @Nullable 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:
-
correlationIdFunction
public <P> HeaderEnricherSpec correlationIdFunction(Function<Message<P>, ?> correlationIdFunction, @Nullable 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:
-
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
public HeaderEnricherSpec replyChannelExpression(String replyChannelExpression, @Nullable Boolean overwrite) 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:
-
replyChannelFunction
public <P> HeaderEnricherSpec replyChannelFunction(Function<Message<P>, ?> replyChannelFunction, @Nullable 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:
-
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
public HeaderEnricherSpec errorChannelExpression(String errorChannelExpression, @Nullable Boolean overwrite) 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:
-
errorChannelFunction
public <P> HeaderEnricherSpec errorChannelFunction(Function<Message<P>, ?> errorChannelFunction, @Nullable 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:
-
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
public HeaderEnricherSpec priorityExpression(String priorityExpression, @Nullable Boolean overwrite) 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:
-
priorityFunction
public <P> HeaderEnricherSpec priorityFunction(Function<Message<P>, ?> priorityFunction, @Nullable 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:
-
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, @Nullable 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:
-
expirationDateFunction
public <P> HeaderEnricherSpec expirationDateFunction(Function<Message<P>, ?> expirationDateFunction, @Nullable 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:
-
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
public HeaderEnricherSpec headerExpression(String name, String expression, @Nullable Boolean overwrite) 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:
-
headerFunction
public <P> HeaderEnricherSpec headerFunction(String name, Function<Message<P>, ?> function, @Nullable 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:
-
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:
-
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:
-
doGet
protected reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,MessageTransformingHandler> doGet()- Overrides:
doGet
in classConsumerEndpointSpec<HeaderEnricherSpec,
MessageTransformingHandler>
-