All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.otto.synapse.configuration.MessageEndpointConfigurer Maven / Gradle / Ivy

Go to download

A library used at otto.de to implement Spring Boot based event-sourcing microservices.

There is a newer version: 0.33.1
Show newest version
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) {}; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy