Interface ExecutorChannelInterceptor
- All Superinterfaces:
- ChannelInterceptor
An extension of 
ChannelInterceptor with callbacks to intercept the
 asynchronous sending of a Message to
 a specific subscriber through an Executor.
 Supported on MessageChannel
 implementations that can be configured with an Executor.- Since:
- 4.1
- Author:
- Rossen Stoyanchev
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidafterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, @Nullable Exception ex) Invoked inside theRunnablesubmitted to the Executor after calling the target MessageHandler regardless of the outcome (i.e.beforeHandle(Message<?> message, MessageChannel channel, MessageHandler handler) Invoked inside theRunnablesubmitted to the Executor just before calling the target MessageHandler to handle the message.Methods inherited from interface org.springframework.messaging.support.ChannelInterceptorafterReceiveCompletion, afterSendCompletion, postReceive, postSend, preReceive, preSend
- 
Method Details- 
beforeHandledefault @Nullable Message<?> beforeHandle(Message<?> message, MessageChannel channel, MessageHandler handler) Invoked inside theRunnablesubmitted to the Executor just before calling the target MessageHandler to handle the message. Allows for modification of the Message if necessary or whennullis returned the MessageHandler is not invoked.- Parameters:
- message- the message to be handled
- channel- the channel on which the message was sent to
- handler- the target handler to handle the message
- Returns:
- the input message, or a new instance, or null
 
- 
afterMessageHandleddefault void afterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, @Nullable Exception ex) Invoked inside theRunnablesubmitted to the Executor after calling the target MessageHandler regardless of the outcome (i.e. Exception raised or not) thus allowing for proper resource cleanup.Note that this will be invoked only if beforeHandle successfully completed and returned a Message, i.e. it did not return null.- Parameters:
- message- the message handled
- channel- the channel on which the message was sent to
- handler- the target handler that handled the message
- ex- any exception that may have been raised by the handler
 
 
-