[rabbitmq-discuss] Decoding header fields

Bernhard Mogens Ege bme at saseco.dk
Thu Jul 26 12:57:49 BST 2012


Hmm, I guess I have to work a bit on how I send the information, then. In
effect, I send a message like this:

                IBasicProperties bp = channel.CreateBasicProperties();
                bp.Headers = new Dictionary<string,string>{ { "languageid",
"1" } };
                channel.BasicPublish(ExchangeName, routingKey, false, true,
bp, payload);

payload can be null or some byte array. The value string would in my case be
"0" or "1".

So I have to send it differently?
-- 
Bernhard

-----Original Message-----
From: Emile Joubert [mailto:emile at rabbitmq.com] 
Sent: 26. juli 2012 13:31
To: bme at saseco.dk; Discussions about RabbitMQ
Subject: Re: [rabbitmq-discuss] Decoding header fields

Hi,

On 26/07/12 10:12, Bernhard Mogens Ege wrote:
> The keys I can iterate through and make direct lookups against, but 
> the values are returned as objects but are in reality Byte[].

I would expect a byte array if the producer populated the field with a byte
array (prefixed by 'x'), but it could be any of AMQP table field type.
Consumers and producers may agree on types for certain keys beforehand, or
the consumer can determine the type at runtime using GetType().

See RabbitMQ.Client.Impl.WireFormatting.ReadFieldValue() for the relevant
implementation and mapping between AMQP types and .NET types.


-Emile







More information about the rabbitmq-discuss mailing list