[rabbitmq-discuss] Describing message type

Garry Shutler garry at robustsoftware.co.uk
Mon Feb 25 17:37:50 GMT 2013


Hi,

I'm looking for some guidance as to how to determine the contents of a
message more accurately before deserializing it.

A bit of background: I need to have a prioritized queuing system, but would
like to be able to push multiple types of task into that system that a
worker/workers can consume.

I've emulated the prioritization (as from what I could find RabbitMQ does
not support this out of the box) by having two queues: "high" and "normal".
However, each queue could contain several types of message and therefore
the consumer(s) need to know what code they should invoke for the message.

At the moment I am leaning towards using the content type of the message
with something like:

application/json ; type=<message-type> version=<version>
>

This complies with what I prefer to do in HTTP and is also fairly
standardized. From the combination of type and version the consumer will
know the shape of the data (perhaps the class to deserialize to in static
languages) and also which code to invoke.

Is there a preferred/standard way of achieving what I'm trying? I realize I
could be on entirely the wrong track.

Thanks in advance,

*Garry Shutler*

@gshutler <http://twitter.com/gshutler>
gshutler.com
evenitron.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130225/b4a1f98c/attachment.htm>


More information about the rabbitmq-discuss mailing list