Interface IRpcClientBuilder
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
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
Returns
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
Returns
ReplyToQueue(IQueueSpecification)
IRpcClientBuilder ReplyToQueue(IQueueSpecification replyToQueue)
Parameters
replyToQueue
IQueueSpecification
Returns
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
stringThe queue name
Returns
RequestAddress()
Request address where the client sends requests. The server consumes requests from this address.
IRpcClientAddressBuilder RequestAddress()
Returns
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
Returns
Timeout(TimeSpan)
The time to wait for a reply from the server.
IRpcClientBuilder Timeout(TimeSpan timeout)
Parameters
timeout
TimeSpan