Interface DispatchInterceptor
- All Known Implementing Classes:
AdhocDispatchInterceptor,AuthenticatingInterceptor,CorrelatingInterceptor,DataProtectionInterceptor,MessageRoutingInterceptor,SchedulingInterceptor,WebResponseCompressingInterceptor,WebsocketResponseInterceptor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Mechanism that enables modification of a message before it is dispatched to local handlers or Flux Capacitor. Also
can be used to monitor outgoing messages or block message publication altogether.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault DispatchInterceptorandThen(DispatchInterceptor nextInterceptor) interceptDispatch(Message message, MessageType messageType) Intercepts the publication of a message.default SerializedMessagemodifySerializedMessage(SerializedMessage serializedMessage, Message message, MessageType messageType) Enables modification of theSerializedMessagebefore it is published.
-
Field Details
-
noOp
-
-
Method Details
-
interceptDispatch
Intercepts 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. -
modifySerializedMessage
default SerializedMessage modifySerializedMessage(SerializedMessage serializedMessage, Message message, MessageType messageType) Enables modification of theSerializedMessagebefore it is published.This method is typically invoked by message gateways right before publication of a message (so after
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 useinterceptDispatch(io.fluxcapacitor.javaclient.common.Message, io.fluxcapacitor.common.MessageType)for that. -
andThen
-