Interface RpcClientBuilder


public interface RpcClientBuilder
API to configure and create a RpcClient.
  • Method Details

    • requestAddress

      Builder for the request address.
      Returns:
      the request address builder
    • replyToQueue

      RpcClientBuilder replyToQueue(String replyToQueue)
      The queue the client expects responses on.

      The queue must exist if it is set.

      The RPC client will create an exclusive, auto-delete queue if it is not set.

      Parameters:
      replyToQueue - reply queue
      Returns:
      this builder instance
    • correlationIdSupplier

      RpcClientBuilder correlationIdSupplier(Supplier<Object> correlationIdSupplier)
      The generator for correlation ID.

      The default generator uses a fixed random UUID prefix and a strictly monotonic increasing sequence suffix.

      Parameters:
      correlationIdSupplier - correlation ID generator
      Returns:
      the this builder instance
    • requestPostProcessor

      RpcClientBuilder requestPostProcessor(BiFunction<Message,Object,Message> requestPostProcessor)
      A callback before sending a request message.

      The callback accepts the request message and the correlation ID as parameters. It must return the message that will be sent as request, after having potentially modified it.

      The default post-processor sets the reply-to field and assigns the correlation ID to the message ID field.

      Parameters:
      requestPostProcessor - logic to post-process request message
      Returns:
      this builder instance
    • correlationIdExtractor

      RpcClientBuilder correlationIdExtractor(Function<Message,Object> correlationIdExtractor)
      Callback to extract the correlation ID from a reply message.

      The correlation ID is then used to correlate the reply message to an outstanding request message.

      The default implementation uses the correlation ID field.

      Parameters:
      correlationIdExtractor - correlation ID extractor
      Returns:
      this builder instance
    • requestTimeout

      RpcClientBuilder requestTimeout(Duration timeout)
      Timeout before failing outstanding requests.
      Parameters:
      timeout - timeout
      Returns:
      the builder instance
    • build

      RpcClient build()
      Build the configured instance.
      Returns:
      the configured instance