Class DefaultGenericGateway
- All Implemented Interfaces:
Namespaced<GenericGateway>, GenericGateway, HasLocalHandlers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this gateway and releases any underlying resources.protected GenericGatewaycreateForNamespace(String namespace) protected CompletableFuture<Message> sendAndForget(Guarantee guarantee, Message... messages) Sends multipleMessageobjects with a guarantee.sendAndForget(Guarantee guarantee, UnaryOperator<SerializedMessage> interceptor, Message... messages) Sends multipleMessageobjects with a guarantee.<R> RsendAndWait(Message message) Sends a message and blocks for a result with a configurable timeout.sendForMessage(Message message, Duration timeout) Sends a single request message with the given effective timeout.sendForMessages(Message... messages) Sends multiple messages and returns futures for their fullMessageresponses.setRetentionTime(Duration duration, Guarantee guarantee) Set a new retention duration for the underlying gateway's message log.Truncates this gateway's message log and clears associated tracking positions.Methods inherited from class AbstractNamespaced
forNamespaceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GenericGateway
send, send, send, send, send, send, sendAndForget, sendAndForget, sendAndForget, sendAndForget, sendAndForget, sendAndForget, sendAndWait, sendAndWait, sendAndWait, sendAndWait, sendForMessage, setRetentionTime, truncateMethods inherited from interface HasLocalHandlers
hasLocalHandlers, registerHandler, registerHandler, setSelfHandlerFilterMethods inherited from interface Namespaced
forDefaultNamespace, forNamespace
-
Constructor Details
-
DefaultGenericGateway
public DefaultGenericGateway()
-
-
Method Details
-
createForNamespace
- Specified by:
createForNamespacein classAbstractNamespaced<GenericGateway>
-
sendAndForget
Description copied from interface:GenericGatewaySends multipleMessageobjects with a guarantee.- Specified by:
sendAndForgetin interfaceGenericGateway
-
sendAndForget
public CompletableFuture<Void> sendAndForget(Guarantee guarantee, UnaryOperator<SerializedMessage> interceptor, Message... messages) Description copied from interface:GenericGatewaySends multipleMessageobjects with a guarantee.Before the messages are appended to the message log in Fluxzero, they can be inspected, blocked or modified using the given interceptor.
- Specified by:
sendAndForgetin interfaceGenericGateway
-
sendForMessages
Description copied from interface:GenericGatewaySends multiple messages and returns futures for their fullMessageresponses.- Specified by:
sendForMessagesin interfaceGenericGateway
-
sendAndWait
Description copied from interface:GenericGatewaySends a message and blocks for a result with a configurable timeout.Timeout can be customized using
@Timeouton the payload class.- Specified by:
sendAndWaitin interfaceGenericGateway
-
sendForMessage
Description copied from interface:GenericGatewaySends a single request message with the given effective timeout.The effective timeout is used for the returned future and is propagated as request metadata so tracking handlers can skip stale indexed requests before invocation. If
timeoutisnull, the gateway falls back to timeout metadata already present on the message, then@Timeouton the payload class, and finally the request handler default. A negative timeout disables timeout handling for this request.- Specified by:
sendForMessagein interfaceGenericGateway- Parameters:
message- the message to sendtimeout- the timeout for this request;nulluses the gateway/request handler defaults- Returns:
- a future that completes with the response message
-
setRetentionTime
Description copied from interface:GenericGatewaySet a new retention duration for the underlying gateway's message log.The retention setting determines how long messages in this log are retained by the system, after which they may be evicted or deleted depending on the platform policy.
- Specified by:
setRetentionTimein interfaceGenericGateway- Parameters:
duration- the new retention durationguarantee- the delivery guarantee to apply to the update operation- Returns:
- a
CompletableFuturethat completes once the retention setting is updated
-
truncate
Description copied from interface:GenericGatewayTruncates this gateway's message log and clears associated tracking positions.- Specified by:
truncatein interfaceGenericGateway- Parameters:
guarantee- the delivery guarantee to apply to the truncate operation- Returns:
- a
CompletableFuturethat completes once the log is truncated
-
emptyReturnMessage
-
close
public void close()Description copied from interface:GenericGatewayCloses this gateway and releases any underlying resources.- Specified by:
closein interfaceGenericGateway- Overrides:
closein classAbstractNamespaced<GenericGateway>
-