[rabbitmq-discuss] Different objects being passed thru RabbitMQ
curylod at asme.org
Fri Aug 17 21:02:49 BST 2012
On Fri, Aug 17, 2012 at 3:44 PM, Wizaerd <wizaerd at gmail.com> wrote:
> 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.
You probably can't pass the Type itself into the header, but you should be
able to pass in the fully qualified type name as a string.
var props = model.CreateBasicProperties();
props.Headers["type"] = typof(User).AssemblyQualifiedName;
Then on the other end, you should be able to get out the type name, use
Type.GetType(typeName, true) to load the type, and perform deserialization
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss