[rabbitmq-discuss] Java RabbitMQ API bug in response.getHeaders()?
tonygarnockjones+rabbitmq at gmail.com
Thu Oct 27 17:06:48 BST 2011
On 27 October 2011 10:41, Mario Leyton <mleyton at niclabs.cl> wrote:
> We are using rabbitmq java client and I believe the following is a bug:
Nope, it's deliberate. null, here, represents that no headers were sent.
This is distinct from an empty map being sent. AMQP's basic properties
structure includes "absent/present" bits for all of the fields; we chose to
use "null" to represent "missing", as in this instance it is unambiguous.
In languages like ML and Haskell we'd use 'whatever option and Maybe
whatever, respectively. In C, we use a bitmap stored separately from the
struct members concerned.
So when reading (or writing!) basic properties in Java,
- null means "missing value" or "no value"
- empty map, empty string etc. is a *present* value but is otherwise
- non-empty maps, strings, etc are present values
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss