Class DefaultWebRequestGateway
java.lang.Object
io.fluxcapacitor.javaclient.publishing.DefaultWebRequestGateway
- All Implemented Interfaces:
WebRequestGateway
,HasLocalHandlers
Default implementation of the
WebRequestGateway
interface that delegates requests to a configured
GenericGateway
. This class acts as a bridge for handling outbound web requests using Flux Platform’s proxy
mechanism.
It supports sending web requests in both asynchronous (fire-and-forget, future-based) and synchronous (blocking) manners, utilizing the underlying delegate to process the actual interactions with the Flux platform.
- See Also:
-
Field Summary
Fields inherited from interface io.fluxcapacitor.javaclient.publishing.WebRequestGateway
defaultSettings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsend
(WebRequest request) Sends the given web request and returns a future that completes with the response.sendAndForget
(Guarantee guarantee, WebRequest... requests) Sends one or more web requests without waiting for a response.sendAndWait
(WebRequest request, WebRequestSettings settings) Sends the given web request and waits for the response synchronously using the specified request settings.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.tracking.handling.HasLocalHandlers
hasLocalHandlers, registerHandler, registerHandler, setSelfHandlerFilter
Methods inherited from interface io.fluxcapacitor.javaclient.publishing.WebRequestGateway
close, sendAndWait
-
Constructor Details
-
DefaultWebRequestGateway
public DefaultWebRequestGateway()
-
-
Method Details
-
sendAndForget
Description copied from interface:WebRequestGateway
Sends one or more web requests without waiting for a response.Use this for fire-and-forget scenarios (e.g., async webhook posts).
- Specified by:
sendAndForget
in interfaceWebRequestGateway
- Parameters:
guarantee
- indicates whether to wait until the request is sent or storedrequests
- the web requests to send- Returns:
- a future that completes once the requests have been sent or stored
-
send
Description copied from interface:WebRequestGateway
Sends the given web request and returns a future that completes with the response.The request must have an absolute URL to be forwarded by the Flux proxy.
- Specified by:
send
in interfaceWebRequestGateway
- Parameters:
request
- the web request to send- Returns:
- a future completed with the
WebResponse
-
sendAndWait
Description copied from interface:WebRequestGateway
Sends the given web request and waits for the response synchronously using the specified request settings.This method blocks the calling thread until the request is completed or times out.
- Specified by:
sendAndWait
in interfaceWebRequestGateway
- Parameters:
request
- the web request to sendsettings
- configuration settings for this request (e.g., timeouts, accepted encodings)- Returns:
- the received
WebResponse
-