public class ClientOutputImpl extends Object implements ClientOutput
| Modifier and Type | Field and Description |
|---|---|
protected long |
defaultRequestRetryTimeout |
protected RequestManager |
requestManager |
protected ClientRequestPool |
requestPool |
protected io.zeebe.dispatcher.Dispatcher |
sendBuffer |
| Constructor and Description |
|---|
ClientOutputImpl(io.zeebe.dispatcher.Dispatcher sendBuffer,
ClientRequestPool requestPool,
RequestManager requestManager,
long defaultRequestRetryTimeout) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
sendMessage(TransportMessage transportMessage)
Sends a message according to the single message protocol.
|
ClientRequest |
sendRequest(RemoteAddress addr,
io.zeebe.util.buffer.BufferWriter writer)
Sends a request according to the request response protocol to a given remote
|
ClientRequest |
sendRequestWithRetry(RemoteAddress addr,
io.zeebe.util.buffer.BufferWriter writer)
Same as
ClientOutput.sendRequestWithRetry(RemoteAddress, BufferWriter, long) where the timeout is set to the configured default timeout. |
ClientRequest |
sendRequestWithRetry(RemoteAddress addr,
io.zeebe.util.buffer.BufferWriter writer,
long timeout)
Like
ClientOutput.sendRequest(RemoteAddress, BufferWriter) but retries the request if there is no current connection. |
protected final io.zeebe.dispatcher.Dispatcher sendBuffer
protected final ClientRequestPool requestPool
protected final RequestManager requestManager
protected final long defaultRequestRetryTimeout
public ClientOutputImpl(io.zeebe.dispatcher.Dispatcher sendBuffer,
ClientRequestPool requestPool,
RequestManager requestManager,
long defaultRequestRetryTimeout)
public boolean sendMessage(TransportMessage transportMessage)
ClientOutputSends a message according to the single message protocol.
Returns false if the message cannot be currently written due to exhausted capacity. Throws an exception if the request is not sendable at all (e.g. buffer writer throws exception).
sendMessage in interface ClientOutputpublic ClientRequest sendRequest(RemoteAddress addr, io.zeebe.util.buffer.BufferWriter writer)
ClientOutputSends a request according to the request response protocol to a given remote
Returns null if request cannot be currently written to the send buffer due to exhausted capacity.
Throws an exception if the request is not sendable at all (e.g. buffer writer throws exception).
Returns a future to the response content else.
The future throws fails with NotConnectedException if the addressed remote is currently
not connected.
The returned request object MUST be closed when it is not needed anymore.
Guarantees:
sendRequest in interface ClientOutputpublic ClientRequest sendRequestWithRetry(RemoteAddress addr, io.zeebe.util.buffer.BufferWriter writer, long timeout)
ClientOutputLike ClientOutput.sendRequest(RemoteAddress, BufferWriter) but retries the request if there is no current connection.
Makes this method more robust in the presence of short intermittent disconnects.
Guarantees:
sendRequestWithRetry in interface ClientOutputtimeout - Timeout in milliseconds until the returned future fails if no response is received.public ClientRequest sendRequestWithRetry(RemoteAddress addr, io.zeebe.util.buffer.BufferWriter writer)
ClientOutputClientOutput.sendRequestWithRetry(RemoteAddress, BufferWriter, long) where the timeout is set to the configured default timeout.sendRequestWithRetry in interface ClientOutputCopyright © 2017–2018 camunda services GmbH. All rights reserved.