public class DefaultSenderHeadersInterceptor
extends java.lang.Object
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 customized
The property spring.application.name is used to determine the value of the
MSG_SENDER_ATTR header attribute. This attribute can be used to identify the
origin of a message.
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultSenderHeadersInterceptor.Capability
Capabilities of the DefaultSenderHeadersInterceptor.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MSG_ID_ATTR |
static java.lang.String |
MSG_SENDER_ATTR
The sender of the message
|
static java.lang.String |
MSG_TIMESTAMP_ATTR |
| Constructor and Description |
|---|
DefaultSenderHeadersInterceptor(SynapseProperties.Sender senderProperties,
java.util.Set<DefaultSenderHeadersInterceptor.Capability> capabilities,
java.time.Clock clock)
Creates an instance of DefaultSenderHeadersInterceptor with enhanced configuration options.
|
DefaultSenderHeadersInterceptor(SynapseProperties synapseProperties)
Creates a new DefaultSenderHeadersInterceptor with default configuration.
|
| Modifier and Type | Method and Description |
|---|---|
Message<java.lang.String> |
addDefaultHeaders(Message<java.lang.String> message) |
public static final java.lang.String MSG_SENDER_ATTR
public static final java.lang.String MSG_ID_ATTR
public static final java.lang.String MSG_TIMESTAMP_ATTR
public DefaultSenderHeadersInterceptor(SynapseProperties synapseProperties)
By default, all capabilites are enabled.
synapseProperties - the properties used to configure the interceptorpublic DefaultSenderHeadersInterceptor(SynapseProperties.Sender senderProperties, java.util.Set<DefaultSenderHeadersInterceptor.Capability> capabilities, java.time.Clock clock)
senderProperties - the properties used to configure the interceptorcapabilities - the enabled capabilitiesclock - the clock used to generate timestamp attributes@Nullable @MessageInterceptor(endpointType=SENDER) public Message<java.lang.String> addDefaultHeaders(@Nonnull Message<java.lang.String> message)