Package de.otto.synapse.endpoint
Class DefaultSenderHeadersInterceptor
java.lang.Object
de.otto.synapse.endpoint.DefaultSenderHeadersInterceptor
public class DefaultSenderHeadersInterceptor
extends java.lang.Object
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 Classes Modifier and Type Class Description static classDefaultSenderHeadersInterceptor.CapabilityCapabilities of the DefaultSenderHeadersInterceptor. -
Constructor Summary
Constructors Constructor Description DefaultSenderHeadersInterceptor(SynapseProperties synapseProperties)Creates a new DefaultSenderHeadersInterceptor with default configuration.DefaultSenderHeadersInterceptor(SynapseProperties synapseProperties, java.util.Set<DefaultSenderHeadersInterceptor.Capability> capabilities, java.time.Clock clock)Creates an instance of DefaultSenderHeadersInterceptor with enhanced configuration options. -
Method Summary
Modifier and Type Method Description TextMessageaddDefaultHeaders(TextMessage message)
-
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, java.util.Set<DefaultSenderHeadersInterceptor.Capability> capabilities, java.time.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)
-