Package com.rabbitmq.client
Class RpcClientParams
- java.lang.Object
-
- com.rabbitmq.client.RpcClientParams
-
public class RpcClientParams extends Object
Holder class to configure aRpcClient
.- Since:
- 4.10.0
- See Also:
RpcClient(RpcClientParams)
-
-
Constructor Summary
Constructors Constructor Description RpcClientParams()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RpcClientParams
channel(Channel channel)
RpcClientParams
correlationIdSupplier(RpcClient.CorrelationIdSupplier correlationIdGenerator)
Logic to generate correlation IDs.RpcClientParams
exchange(String exchange)
Channel
getChannel()
Set the channel to use for communication.RpcClient.CorrelationIdSupplier
getCorrelationIdSupplier()
String
getExchange()
Set the exchange to send requests to.RpcClient.RpcClientReplyHandler
getReplyHandler()
String
getReplyTo()
String
getRoutingKey()
int
getTimeout()
RpcClientParams
replyHandler(RpcClient.RpcClientReplyHandler replyHandler)
Set the behavior to use when receiving replies.RpcClientParams
replyTo(String replyTo)
Set the queue where the server should put replies on.RpcClientParams
routingKey(String routingKey)
Set the routing key to use for requests.boolean
shouldUseMandatory()
RpcClientParams
timeout(int timeout)
Set the timeout in milliseconds to use on call responses.RpcClientParams
useMandatory()
Instructs to use the mandatory flag when publishing RPC requests.RpcClientParams
useMandatory(boolean useMandatory)
Whether to publish RPC requests with the mandatory flag or not.
-
-
-
Method Detail
-
getChannel
public Channel getChannel()
Set the channel to use for communication.- Returns:
-
channel
public RpcClientParams channel(Channel channel)
-
getExchange
public String getExchange()
Set the exchange to send requests to.- Returns:
-
exchange
public RpcClientParams exchange(String exchange)
-
getRoutingKey
public String getRoutingKey()
-
routingKey
public RpcClientParams routingKey(String routingKey)
Set the routing key to use for requests.- Parameters:
routingKey
-- Returns:
-
getReplyTo
public String getReplyTo()
-
replyTo
public RpcClientParams replyTo(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(RpcClient.RpcClientReplyHandler)
-
useMandatory
public RpcClientParams useMandatory()
Instructs to use the mandatory flag when publishing RPC requests.Unroutable requests will result in
UnroutableRpcRequestException
exceptions thrown. Use a custom reply handler to change this behavior.- Returns:
- See Also:
replyHandler(RpcClient.RpcClientReplyHandler)
-
shouldUseMandatory
public boolean shouldUseMandatory()
-
correlationIdSupplier
public RpcClientParams correlationIdSupplier(RpcClient.CorrelationIdSupplier correlationIdGenerator)
Logic to generate correlation IDs.- Parameters:
correlationIdGenerator
-- Returns:
- Since:
- 4.12.0
-
getCorrelationIdSupplier
public RpcClient.CorrelationIdSupplier getCorrelationIdSupplier()
-
replyHandler
public RpcClientParams replyHandler(RpcClient.RpcClientReplyHandler replyHandler)
Set the behavior to use when receiving replies.The default is to wrap the reply into a
RpcClient.Response
instance. Unroutable requests will result inUnroutableRpcRequestException
exceptions.- Parameters:
replyHandler
-- Returns:
- See Also:
useMandatory()
,useMandatory(boolean)
-
getReplyHandler
public RpcClient.RpcClientReplyHandler getReplyHandler()
-
-