Interface IRpcServerBuilder
IRpcServerBuilder is the interface for creating an RPC server. The RPC server consumes requests from a queue and sends replies to a reply queue. See also IRpcServer and IRpcClientBuilder
public interface IRpcServerBuilder
Methods
BuildAsync()
Build and return the RPC server.
Task<IRpcServer> 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.
IRpcServerBuilder CorrelationIdExtractor(Func<IMessage, object>? correlationIdExtractor)
Parameters
Returns
Handler(RpcHandler)
Handle the request message and return the reply message.
IRpcServerBuilder Handler(RpcHandler handler)
Parameters
handler
RpcHandler
Returns
ReplyPostProcessor(Func<IMessage, object, IMessage>?)
Post processes the reply message before sending it to the client. 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.
IRpcServerBuilder ReplyPostProcessor(Func<IMessage, object, IMessage>? replyPostProcessor)
Parameters
Returns
RequestQueue(IQueueSpecification)
IRpcServerBuilder RequestQueue(IQueueSpecification requestQueue)
Parameters
requestQueue
IQueueSpecification
Returns
RequestQueue(string)
The queue from which requests are consumed. The client sends requests to this queue and the server consumes them.
IRpcServerBuilder RequestQueue(string requestQueue)
Parameters
requestQueue
string