Interface ClientChannel<REQ,RESP>

Type Parameters:
REQ - the request message type
RESP - the response message type
All Superinterfaces:
Channel
All Known Implementing Classes:
MultiplexedChannel, PipelinedChannel, SymmetricChannel

public interface ClientChannel<REQ,RESP> extends Channel
A Channel that sends requests and receives correlated responses.
  • Method Details

    • request

      CompletableFuture<RESP> request(REQ message)
      Sends a message using the channel's configured default timeout and returns a future that completes when a correlated response arrives.
      Parameters:
      message - the message to send
      Returns:
      a future that completes with the correlated response
      Throws:
      DuplicateCorrelationIdException - if the correlation id is already pending
    • request

      CompletableFuture<RESP> request(REQ message, Duration timeout)
      Sends a message with a per-request timeout override.
      Parameters:
      message - the message to send
      timeout - the timeout for this request; must be positive
      Returns:
      a future that completes with the correlated response