de.otto.synapse.configuration.MessageEndpointConfigurer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of synapse-core Show documentation
Show all versions of synapse-core Show documentation
A library used at otto.de to implement Spring Boot based event-sourcing microservices.
package de.otto.synapse.configuration;
import de.otto.synapse.endpoint.AbstractMessageEndpoint;
import de.otto.synapse.endpoint.MessageInterceptorRegistry;
/**
* A configurer used to configure {@link AbstractMessageEndpoint message endpoints}.
*
* Configurations may implement this interface in order to configure message endpoints. For example:
*
*
* public class ExampleConfiguration implements MessageEndpointConfigurer {
*
* private static final Logger LOG = getLogger(ExampleConfiguration.class);
*
* @Override
* public void configureMessageInterceptors(final MessageInterceptorRegistry registry) {
*
* registry.register(receiverChannelsWith((m) -> {
* LOG.info("[receiver] Intercepted message " + m);
* return m;
* }));
*
* registry.register(senderChannelsWith((m) -> {
* LOG.info("[sender] Intercepted message " + m);
* return m;
* }));
*
* }
*
* // ...
* }
*
*/
public interface MessageEndpointConfigurer {
/**
*
* Registers {@link de.otto.synapse.endpoint.MessageInterceptor message interceptors} used to intercept messages
* at the sender- and/or receiver-side.
*
* @param registry MessageInterceptorRegistry used to register the interceptors.
*/
default void configureMessageInterceptors(final MessageInterceptorRegistry registry) {};
}