Package com.rabbitmq.client.amqp
Interface RpcClientBuilder
public interface RpcClientBuilder
API to configure and create a
RpcClient
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Builder for the request address. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the configured instance.correlationIdExtractor
(Function<Message, Object> correlationIdExtractor) Callback to extract the correlation ID from a reply message.correlationIdSupplier
(Supplier<Object> correlationIdSupplier) The generator for correlation ID.replyToQueue
(String replyToQueue) The queue the client expects responses on.Builder for the request address.requestPostProcessor
(BiFunction<Message, Object, Message> requestPostProcessor) A callback before sending a request message.requestTimeout
(Duration timeout) Timeout before failing outstanding requests.
-
Method Details
-
requestAddress
RpcClientBuilder.RpcClientAddressBuilder requestAddress()Builder for the request address.- Returns:
- the request address builder
-
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
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
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
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
Timeout before failing outstanding requests.- Parameters:
timeout
- timeout- Returns:
- the builder instance
-
build
RpcClient build()Build the configured instance.- Returns:
- the configured instance
-