[rabbitmq-discuss] Question on internal guid or hashing msg content

Matthew Sackman matthew at rabbitmq.com
Sat Jan 22 22:52:33 GMT 2011

Hi Jon,

On Sat, Jan 22, 2011 at 04:45:28PM -0600, Jon Brisbin wrote:
> Can I use the guid property of #basic_message{} for this

Yes, that's what we do. Check the type sigs of msg_store - the key there
is always the guid.

> or would I still get unnecessary duplication (I guess I'm wondering if the same message content can have different guids for sending to multiple queues)?

The guid is created and applied in the channel on basic.publish. Then it
is routed to various queues. Thus every queue receiving said msg sees it
in the same #basic_message record with the same guid.

> Or should I hash the message content and use that as the key?

Agh! don't do that - for one thing it'll be slow. But much worse than
that is that many many messages will have the same content but will not
be from the same basic.publish. So hashing them to the same thing is a
very bad idea.


More information about the rabbitmq-discuss mailing list