Interface RpcClient

All Superinterfaces:
AutoCloseable

public interface RpcClient extends AutoCloseable
Client support class for RPC.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the RPC client and its resources.
    Create a message meant to be published by the underlying publisher instance.
    message(byte[] body)
    Create a message meant to be published by the underlying publisher instance.
    publish(Message message)
    Publish a request message and expect a response.
  • Method Details

    • message

      Message message()
      Create a message meant to be published by the underlying publisher instance.

      Once published with the publish(Message) the message instance should be not be modified or even reused.

      Returns:
      a message
    • message

      Message message(byte[] body)
      Create a message meant to be published by the underlying publisher instance.

      Once published with the publish(Message) the message instance should be not be modified or even reused.

      Parameters:
      body - message body
      Returns:
      a message with the provided body
    • publish

      CompletableFuture<Message> publish(Message message)
      Publish a request message and expect a response.
      Parameters:
      message - message request
      Returns:
      the response as CompletableFuture
    • close

      void close()
      Close the RPC client and its resources.
      Specified by:
      close in interface AutoCloseable