Package de.otto.synapse.endpoint
Class DefaultSenderHeadersInterceptor
- java.lang.Object
-
- de.otto.synapse.endpoint.DefaultSenderHeadersInterceptor
-
public class DefaultSenderHeadersInterceptor extends java.lang.ObjectAmessage interceptorthat is able to add some commonly required header attributes in Synapse services.The
DefaultSenderHeadersInterceptoris active by default for allsender endpoints. It can be disabled by * setting 'synapse.sender.default-headers.enabled=false'.The property
spring.application.nameis used to determine the value of theDefaultHeaderAttr.MSG_SENDERheader 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 Detail
-
DefaultSenderHeadersInterceptor
public DefaultSenderHeadersInterceptor(SynapseProperties synapseProperties)
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 Detail
-
addDefaultHeaders
@Nullable @MessageInterceptor(endpointType=SENDER) public TextMessage addDefaultHeaders(@Nonnull TextMessage message)
-
-