Package de.otto.synapse.endpoint
Class DefaultReceiverHeadersInterceptor
java.lang.Object
de.otto.synapse.endpoint.DefaultReceiverHeadersInterceptor
public class DefaultReceiverHeadersInterceptor
extends java.lang.Object
A
message interceptor that is able to add some commonly required header attributes in
Synapse services.
The DefaultReceiverHeadersInterceptor is active by default for all
receiver endpoints. It can be disabled by
setting 'synapse.receiver.default-headers.enabled=false'.
-
Constructor Summary
Constructors Constructor Description DefaultReceiverHeadersInterceptor(SynapseProperties synapseProperties)Creates a new DefaultReceiverHeadersInterceptor with default configuration.DefaultReceiverHeadersInterceptor(SynapseProperties synapseProperties, java.time.Clock clock)Creates an instance of DefaultReceiverHeadersInterceptor for testing purposes. -
Method Summary
Modifier and Type Method Description TextMessageaddDefaultHeaders(TextMessage message)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DefaultReceiverHeadersInterceptor
Creates a new DefaultReceiverHeadersInterceptor with default configuration.- Parameters:
synapseProperties- the properties used to configure the interceptor
-
DefaultReceiverHeadersInterceptor
public DefaultReceiverHeadersInterceptor(SynapseProperties synapseProperties, java.time.Clock clock)Creates an instance of DefaultReceiverHeadersInterceptor for testing purposes.- Parameters:
synapseProperties- the properties used to configure the interceptorclock- the clock used to generate timestamp attributes
-
-
Method Details
-
addDefaultHeaders
@Nullable @MessageInterceptor(endpointType=RECEIVER) public TextMessage addDefaultHeaders(@Nonnull TextMessage message)
-