Table of Contents

Interface IRpcClientBuilder

Namespace
RabbitMQ.AMQP.Client
Assembly
RabbitMQ.AMQP.Client.dll

IRpcClientBuilder is the interface for creating an RPC client. See also IRpcClient and IRpcServerBuilder

public interface IRpcClientBuilder

Methods

BuildAsync()

Build and return the RPC client.

Task<IRpcClient> BuildAsync()

Returns

Task<IRpcClient>

CorrelationIdExtractor(Func<IMessage, object>?)

Extracts the correlation id from the request message. each message has a correlation id that is used to match the request with the response. There are default implementations for the correlation id extractor. With this method, you can provide a custom implementation.

IRpcClientBuilder CorrelationIdExtractor(Func<IMessage, object>? correlationIdExtractor)

Parameters

correlationIdExtractor Func<IMessage, object>

Returns

IRpcClientBuilder

CorrelationIdSupplier(Func<object>?)

Client and Server must agree on the correlation id. The client will provide the correlation id to send to the server. If the default correlation id is not suitable, you can provide a custom correlation id supplier. Be careful to provide a unique correlation id for each request.

IRpcClientBuilder CorrelationIdSupplier(Func<object>? correlationIdSupplier)

Parameters

correlationIdSupplier Func<object>

Returns

IRpcClientBuilder

ReplyToQueue(IQueueSpecification)

IRpcClientBuilder ReplyToQueue(IQueueSpecification replyToQueue)

Parameters

replyToQueue IQueueSpecification

Returns

IRpcClientBuilder

ReplyToQueue(string)

The queue from which requests are consumed. if not set the client will create a temporary queue.

IRpcClientBuilder ReplyToQueue(string replyToQueueName)

Parameters

replyToQueueName string

The queue name

Returns

IRpcClientBuilder

RequestAddress()

Request address where the client sends requests. The server consumes requests from this address.

IRpcClientAddressBuilder RequestAddress()

Returns

IRpcClientAddressBuilder

RequestPostProcessor(Func<IMessage, object, IMessage>?)

Post processes the reply message before sending it to the server. The object parameter is the correlation id extracted from the request message. There are default implementations for the reply post processor that use the correlationId() field to set the correlation id of the reply message. With this method, you can provide a custom implementation.

IRpcClientBuilder RequestPostProcessor(Func<IMessage, object, IMessage>? requestPostProcessor)

Parameters

requestPostProcessor Func<IMessage, object, IMessage>

Returns

IRpcClientBuilder

Timeout(TimeSpan)

The time to wait for a reply from the server.

IRpcClientBuilder Timeout(TimeSpan timeout)

Parameters

timeout TimeSpan

Returns

IRpcClientBuilder