[rabbitmq-discuss] Passing null for 'arguments' to queueBind()

michi.oshima moshima at advent.com
Mon Nov 8 17:34:31 GMT 2010


Hi,

I'm using rabbitmq server 2.1.0 and rabbitmq java client 2.1.0.  

I'm currently exploring 'headers' exchange type.  I'd publish a message with
argument table set to 'A' for example, with the intent that consumer with
the matching argument 'A' would receive the message.  And those consumers
who do not specify 'A' would not get the message.

I'm finding that a consumer ends up receiving all messages if I pass null as
the value for the 'arguments' parameter.  I am using the following
queueBind() method of the Channel interface:

AMQP.Queue.BindOk queueBind(java.lang.String queue,
                            java.lang.String exchange,
                            java.lang.String routingKey,
                           
java.util.Map<java.lang.String,java.lang.Object> arguments)
                            throws java.io.IOException

1. Is this intended?  That is, I merely have to specify null for 'arguments'
to receive all messages.
2. Is there any way to prevent a client from subscribing to all messages?
3. Is this an operator error?  Am I setting things up incorrectly?

What I'm trying to achieve is some degree of message privacy.  Consumer A
would put the key 'A' to argument to receive all messages meant for A, and
Consumer B would put the key 'B' to argument to receive all messages meant
for B.  Consumer A is prevented from receiving messages meant for Consumer
B, simply because he is ignorant of the key 'B'.  

4. Is there a better way to achieve message privacy?



-- 
View this message in context: http://old.nabble.com/Passing-null-for-%27arguments%27-to-queueBind%28%29-tp30162963p30162963.html
Sent from the RabbitMQ mailing list archive at Nabble.com.



More information about the rabbitmq-discuss mailing list