You could just make a generic object that you are sending to rabbit with 2 properties, one being the type of object you're sending, and the other being the actual serialized object. You'd have to update your consumers to be able to handle that though.<br>
<br>It might be better to just send json though, so you'd be working with something that could have dynamic properties.<br><br>-Alex<br><br><div class="gmail_quote">On Fri, Aug 17, 2012 at 2:44 PM, Wizaerd <span dir="ltr"><<a href="mailto:wizaerd@gmail.com" target="_blank">wizaerd@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm working well with RabbitMQ thus far, however I have a question about how to approach something. Right now I have a series of consumer applications that knows exactly what type of serislaized object is coming to the queue, as they are specialized for the specific object types to process. However, the architect wants a more generic listener that pull messages from the queue, but the messages body would be a different type of serialized object. for example it could be a User object, or a Course object, etc... In my listener, what is the best way to dynamically determine the type of object being passed in, thus being able to deserialize it and work with it? I had tried adding a custom header to the headers collection with the Type, but RabbitMQ threw an error, and I was never able to get the Type to pass thru, plus there was no way to dynamically deserialize into the Type of object. Unfortunately, the Type of object is not going to be acceptable.<div>
<br></div><div>Anyone have any suggestion I could try and/or research?</div><br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br>