<div dir="ltr"><div style>Hi,</div><div style><br></div><div style>I&#39;m looking for some guidance as to how to determine the contents of a message more accurately before deserializing it.</div><div style><br></div><div style>
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.</div><div style><br></div><div style>I&#39;ve emulated the prioritization (as from what I could find RabbitMQ does not support this out of the box) by having two queues: &quot;high&quot; and &quot;normal&quot;. 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.</div>
<div style><br></div><div style>At the moment I am leaning towards using the content type of the message with something like:</div><div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<font face="courier new, monospace">application/json ; type=&lt;message-type&gt; version=&lt;version&gt;</font><br></blockquote><div style><br></div><div style>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.</div>
<div style><br></div><div style>Is there a preferred/standard way of achieving what I&#39;m trying? I realize I could be on entirely the wrong track.</div><div style><br></div><div style>Thanks in advance,</div><br clear="all">
<div><div dir="ltr"><b>Garry Shutler</b><div><br><div><a href="http://twitter.com/gshutler" target="_blank">@gshutler</a></div><a href="http://gshutler.com/" target="_blank">gshutler.com</a><div><a href="http://evenitron.com" target="_blank">evenitron.com</a></div>
</div></div></div>
</div>