Class DefaultResultGateway
java.lang.Object
io.fluxcapacitor.javaclient.publishing.DefaultResultGateway
- All Implemented Interfaces:
ResultGateway
Default implementation of the
ResultGateway
interface for sending response messages.
This class is responsible for handling responses to commands, queries, dispatching the result message to the
specified target using a GatewayClient
.
The dispatch process utilizes the DispatchInterceptor
and ResponseMapper
to modify or monitor
messages before they are sent.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SerializedMessage
interceptDispatch
(Object payload, Metadata metadata) Sends a response with the specified payload, metadata, target, request ID, and delivery guarantee.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.javaclient.publishing.ResultGateway
respond
-
Constructor Details
-
DefaultResultGateway
public DefaultResultGateway()
-
-
Method Details
-
respond
public CompletableFuture<Void> respond(Object payload, Metadata metadata, String target, Integer requestId, Guarantee guarantee) Description copied from interface:ResultGateway
Sends a response with the specified payload, metadata, target, request ID, and delivery guarantee.This method gives full control over how and when the response is delivered.
- Specified by:
respond
in interfaceResultGateway
- Parameters:
payload
- the payload of the responsemetadata
- additional metadata to includetarget
- the intended recipient of the responserequestId
- the identifier of the original requestguarantee
- delivery guarantee (e.g.,Guarantee.SENT
orGuarantee.STORED
)- Returns:
- a
CompletableFuture
that completes when the response is dispatched (depending on the guarantee)
-
interceptDispatch
-