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

de.otto.synapse.endpoint.MessageInterceptor 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.endpoint;

import de.otto.synapse.message.TextMessage;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * Message interceptors are used to intercept messages before they are sent or received by
 * {@link AbstractMessageEndpoint message endpoints}.
 *
 * 

* MessageInterceptors will usually be chained using a {@link InterceptorChain}. *

*

* A {@code MessageInterceptor} can be used in different ways like, for example: *

*
    *
  • Logging
  • *
  • Calculating Metrics
  • *
  • Wire Taps
  • *
  • {@link MessageFilter Message Filters}
  • *
*

* ...and many other. *

*

* Message Filter *

* * @see EIP: Message Filter * @see EIP: Wire Taps */ @FunctionalInterface public interface MessageInterceptor { /** * Intercept a message and return the same message, a modified version of the incoming message, or null, if * the message should be filtered out and dropped by the {@link AbstractMessageEndpoint} * * @param message the channel-layer message with payload-type beeing a String * @return intercepted version of the message, or null if the message should be dropped. */ @Nullable TextMessage intercept(final @Nonnull TextMessage message); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy