public class RpcClientParams extends Object
RpcClient
.RpcClient(RpcClientParams)
Constructor and Description |
---|
RpcClientParams() |
Modifier and Type | Method and Description |
---|---|
RpcClientParams |
channel(Channel channel) |
RpcClientParams |
correlationIdSupplier(Supplier<String> correlationIdGenerator)
Logic to generate correlation IDs.
|
RpcClientParams |
exchange(String exchange) |
Channel |
getChannel()
Set the channel to use for communication.
|
Supplier<String> |
getCorrelationIdSupplier() |
String |
getExchange()
Set the exchange to send requests to.
|
Function<Object,RpcClient.Response> |
getReplyHandler() |
String |
getReplyTo() |
String |
getRoutingKey() |
int |
getTimeout() |
RpcClientParams |
replyHandler(Function<Object,RpcClient.Response> 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.
|
public Channel getChannel()
public RpcClientParams channel(Channel channel)
public String getExchange()
public RpcClientParams exchange(String exchange)
public String getRoutingKey()
public RpcClientParams routingKey(String routingKey)
routingKey
- public String getReplyTo()
public RpcClientParams replyTo(String replyTo)
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.
replyTo
- public int getTimeout()
public RpcClientParams timeout(int timeout)
timeout
- public RpcClientParams useMandatory(boolean useMandatory)
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.
useMandatory
- replyHandler(Function)
public RpcClientParams useMandatory()
Unroutable requests will result in UnroutableRpcRequestException
exceptions
thrown. Use a custom reply handler to change this behavior.
replyHandler(Function)
public boolean shouldUseMandatory()
public RpcClientParams correlationIdSupplier(Supplier<String> correlationIdGenerator)
correlationIdGenerator
- public Function<Object,RpcClient.Response> getReplyHandler()
public RpcClientParams replyHandler(Function<Object,RpcClient.Response> replyHandler)
The default is to wrap the reply into a RpcClient.Response
instance. Unroutable requests will result in UnroutableRpcRequestException
exceptions.
replyHandler
- useMandatory()
,
useMandatory(boolean)
Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.