Interface RpcServerBuilder


public interface RpcServerBuilder
API to configure and create a RpcServer.
  • Method Details

    • requestQueue

      RpcServerBuilder requestQueue(String requestQueue)
      The queue to wait for requests on.
      Parameters:
      requestQueue - request queue
      Returns:
      this builder instance
    • handler

      The logic to process requests and issue replies.
      Parameters:
      handler - handler
      Returns:
      this builder instance
    • correlationIdExtractor

      RpcServerBuilder correlationIdExtractor(Function<Message,Object> correlationIdExtractor)
      Logic to extract the correlation ID from a request message.

      The default implementation uses the message ID.

      Parameters:
      correlationIdExtractor - logic to extract the correlation ID
      Returns:
      this builder instance
    • replyPostProcessor

      RpcServerBuilder replyPostProcessor(BiFunction<Message,Object,Message> replyPostProcessor)
      A callback called after request processing but before sending the reply message.

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

      The default implementation set the correlation ID field and returns the updated message.

      Parameters:
      replyPostProcessor - logic to post-process reply message
      Returns:
      this builder instance
    • build

      RpcServer build()
      Create the configured instance.
      Returns:
      the configured instance