Reputation: 3355
Not convenient implementation of RPC is here: https://github.com/gaevoy/Gaev.Rpc/tree/master/Gaev.Rpc.Rebus. This implementation has many shortcomings. For example, when clients hundreds they will receive less than 1% of useful responses, and the server will send hundreds of times more data than required.
What is a typical implementation of Remote Procedure Call when using the Rebus with transport RabbitMQ? Something like the RPC implementation that is given in the tutorial on RabbitMQ.
Ideally, I would like to have the implementation that returns a strongly typed task result or exception that could occur on the server when processing the request, similar to how it was in the WCF.
Upvotes: 1
Views: 390
Reputation: 18628
Please never use Rebus to implement RPC(*).
In fact, I do not recommend you use any kind of durable messaging-based technology to implement something that pretends to be synchronous – IMHO it is pretty silly to use a durable centralized broker like RabbitMQ to implement "reliable HTTP" (but that's a discussion that's too big to include here...)
The reason I specifically suggest you do not in any way use Rebus to implement RPC, is because Rebus is permeated with thoughts of asynchronicity and durability, sacrificing raw performance in places where that was required to live up to its delivery guarantee.
While it IS certainly possibly to implement a Task
-based request/response-type of API (which would probably be the fundamental building block of a full-blown RPC protocol with local proxy and marshaled method calls), it is pretty much a violation of the intentions inherent in Rebus' APIs, and thus it will add even more overhead to the mix.
In summary: Rebus is meant to be used for asynchronous messaging, and then it is recommended to use a lightweight request/response-type of communication channel (like HTTP) to implement "remote method calls".
I hope that makes sense :)
(*) By "RPC", I assume you mean a programming API that pretends to be function call-like, i.e. synchronous to the call site (may still be Task
-based)
Upvotes: 3