Class RpcClientParams

    • Field Detail

      • channel

        private Channel channel
        Channel we are communicating on
      • exchange

        private java.lang.String exchange
        Exchange to send requests to
      • routingKey

        private java.lang.String routingKey
        Routing key to use for requests
      • replyTo

        private java.lang.String replyTo
        Queue where the server should put the reply
      • timeout

        private int timeout
        Timeout in milliseconds to use on call responses
      • useMandatory

        private boolean useMandatory
        Whether to publish RPC requests with the mandatory flag or not.
      • replyHandler

        private java.util.function.Function<java.lang.Object,​RpcClient.Response> replyHandler
        Behavior to handle reply messages.
      • correlationIdSupplier

        private java.util.function.Supplier<java.lang.String> correlationIdSupplier
        Logic to generate correlation IDs.
    • Constructor Detail

      • RpcClientParams

        public RpcClientParams()
    • Method Detail

      • getChannel

        public Channel getChannel()
        Set the channel to use for communication.
        Returns:
      • getExchange

        public java.lang.String getExchange()
        Set the exchange to send requests to.
        Returns:
      • exchange

        public RpcClientParams exchange​(java.lang.String exchange)
      • getRoutingKey

        public java.lang.String getRoutingKey()
      • routingKey

        public RpcClientParams routingKey​(java.lang.String routingKey)
        Set the routing key to use for requests.
        Parameters:
        routingKey -
        Returns:
      • getReplyTo

        public java.lang.String getReplyTo()
      • replyTo

        public RpcClientParams replyTo​(java.lang.String replyTo)
        Set the queue where the server should put replies on.

        The default is to use Direct Reply-to. Using another value will cause the creation of a temporary private auto-delete queue.

        The default shouldn't be changed for performance reasons.

        Parameters:
        replyTo -
        Returns:
      • getTimeout

        public int getTimeout()
      • timeout

        public RpcClientParams timeout​(int timeout)
        Set the timeout in milliseconds to use on call responses.
        Parameters:
        timeout -
        Returns:
      • useMandatory

        public RpcClientParams useMandatory​(boolean useMandatory)
        Whether to publish RPC requests with the mandatory flag or not.

        Default is to not publish requests with the mandatory flag set to true.

        When set to true, unroutable requests will result in UnroutableRpcRequestException exceptions thrown. Use a custom reply handler to change this behavior.

        Parameters:
        useMandatory -
        Returns:
        See Also:
        replyHandler(Function)
      • shouldUseMandatory

        public boolean shouldUseMandatory()
      • correlationIdSupplier

        public RpcClientParams correlationIdSupplier​(java.util.function.Supplier<java.lang.String> correlationIdGenerator)
        Logic to generate correlation IDs.
        Parameters:
        correlationIdGenerator -
        Returns:
        Since:
        5.9.0
      • getCorrelationIdSupplier

        public java.util.function.Supplier<java.lang.String> getCorrelationIdSupplier()
      • getReplyHandler

        public java.util.function.Function<java.lang.Object,​RpcClient.Response> getReplyHandler()