How To Handle Message Versioning With RPC?

639 views
Skip to first unread message

Bart Wood

unread,
Jul 29, 2016, 5:24:46 PM7/29/16
to rabbitmq-users
Hello,

I'd like to use RabbitMQ as a remote procedure call broker between a few web applications.  Originally, I thought I might use a Topic exchange and embed the message version in the Routing Key.  So, I might end up with different Queues like CreatePerson_v1 and CreatePerson_v2.

Then I realized I can't really have separate Queues for separate types of RPC calls because in some situations the order of the RPC invocations is important.  Sometimes I need to make sure RPC invocation A happens before invocation B.

If I need to guarantee the order of the RPC invocations, I think that I need to embed the message type and the message version inside of the payload itself.

But this isn't ideal because each app will need to look at the payload and route the RPC invocation to the correct endpoint in code.  We could end up with hundreds of end points.

Has anyone out there solved this problem?  How?

Thanks,



Karl Nilsson

unread,
Aug 1, 2016, 7:45:48 AM8/1/16
to rabbitm...@googlegroups.com
Hi,

The amqp 0.9.1 basic properties include a `type` field which is often used to communicate message type information which means you don't have to interpret the body of the message before passing it on. If you want to use the queue to provide message ordering you will still need some kind of routing component that dispatches to the type/version specific handler in code. 


Message ordering between multiple independent actors in a distributed system is a fairly tricky topic. It is best to try to design your system such that message ordering isn't necessary. Is there anyway you could "batch" the operations that require ordering into a single message?

Cheers
Karl

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Karl Nilsson

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages