Class MessageRoutingInterceptor
java.lang.Object
io.fluxcapacitor.javaclient.publishing.routing.MessageRoutingInterceptor
- All Implemented Interfaces:
DispatchInterceptor
-
Field Summary
Fields inherited from interface io.fluxcapacitor.javaclient.publishing.DispatchInterceptor
noOp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninterceptDispatch(Message message, MessageType messageType) Intercepts the publication of a message.modifySerializedMessage(SerializedMessage serializedMessage, Message m, MessageType messageType) Enables modification of theSerializedMessagebefore it is published.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.fluxcapacitor.javaclient.publishing.DispatchInterceptor
andThen
-
Constructor Details
-
MessageRoutingInterceptor
public MessageRoutingInterceptor()
-
-
Method Details
-
interceptDispatch
Description copied from interface:DispatchInterceptorIntercepts the publication of a message. Implementers can use this to modify the contents of a message or block the publication altogether.Return
nullor throw an exception to prevent publication of the message.- Specified by:
interceptDispatchin interfaceDispatchInterceptor
-
modifySerializedMessage
public SerializedMessage modifySerializedMessage(SerializedMessage serializedMessage, Message m, MessageType messageType) Description copied from interface:DispatchInterceptorEnables modification of theSerializedMessagebefore it is published.This method is typically invoked by message gateways right before publication of a message (so after
DispatchInterceptor.interceptDispatch(io.fluxcapacitor.javaclient.common.Message, io.fluxcapacitor.common.MessageType)is invoked).Although message publication is stopped when
nullis returned or an exception is thrown, it is preferable to useDispatchInterceptor.interceptDispatch(io.fluxcapacitor.javaclient.common.Message, io.fluxcapacitor.common.MessageType)for that.- Specified by:
modifySerializedMessagein interfaceDispatchInterceptor
-