Package de.otto.synapse.endpoint
Class DefaultSenderHeadersInterceptor
java.lang.Object
de.otto.synapse.endpoint.DefaultSenderHeadersInterceptor
A
message interceptor that is able to add some commonly required header attributes in
Synapse services.
The DefaultSenderHeadersInterceptor is active by default for all
sender endpoints. It can be disabled by
* setting 'synapse.sender.default-headers.enabled=false'.
The property spring.application.name is used to determine the value of the
DefaultHeaderAttr.MSG_SENDER header attribute. This attribute can be used to identify the
origin of a message.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCapabilities of the DefaultSenderHeadersInterceptor. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSenderHeadersInterceptor(SynapseProperties synapseProperties) Creates a new DefaultSenderHeadersInterceptor with default configuration.DefaultSenderHeadersInterceptor(SynapseProperties synapseProperties, Set<DefaultSenderHeadersInterceptor.Capability> capabilities, Clock clock) Creates an instance of DefaultSenderHeadersInterceptor with enhanced configuration options. -
Method Summary
-
Constructor Details
-
DefaultSenderHeadersInterceptor
Creates a new DefaultSenderHeadersInterceptor with default configuration.By default, all
capabilitesare enabled.- Parameters:
synapseProperties- the properties used to configure the interceptor
-
DefaultSenderHeadersInterceptor
public DefaultSenderHeadersInterceptor(SynapseProperties synapseProperties, Set<DefaultSenderHeadersInterceptor.Capability> capabilities, Clock clock) Creates an instance of DefaultSenderHeadersInterceptor with enhanced configuration options.- Parameters:
synapseProperties- the properties used to configure the interceptorcapabilities- the enabled capabilitiesclock- the clock used to generate timestamp attributes
-
-
Method Details
-
addDefaultHeaders
@Nullable @MessageInterceptor(endpointType=SENDER) public TextMessage addDefaultHeaders(@Nonnull TextMessage message)
-