Interface MessageInterceptor<T>
- Type Parameters:
T- theMessagepayload type.
public interface MessageInterceptor<T>
Interface for intercepting messages before and after execution.
- Since:
- 3.0
- Author:
- Tomaz Fernandes
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterProcessing(Collection<Message<T>> messages, Throwable t) Perform an action after the listener completes either with success or error.default voidafterProcessing(Message<T> message, Throwable t) Perform an action after the listener completes either with success or error.default Collection<Message<T>>intercept(Collection<Message<T>> messages) Perform an action on the messages or return a different ones before processing.Perform an action on the message or return a different one before processing.
-
Method Details
-
intercept
Perform an action on the message or return a different one before processing. Executed before processing. This method must not return null.- Parameters:
message- the message to be intercepted.- Returns:
- a completable future containing the resulting message.
-
intercept
Perform an action on the messages or return a different ones before processing. Executed before processing. This method must not return null or an empty collection.- Parameters:
messages- the message to be intercepted.- Returns:
- a completable future containing the resulting message.
-
afterProcessing
Perform an action after the listener completes either with success or error.- Parameters:
message- the message to be intercepted.
-
afterProcessing
Perform an action after the listener completes either with success or error.- Parameters:
messages- the messages to be intercepted.
-