[rabbitmq-discuss] Private messages
moshima at advent.com
Mon Dec 27 15:41:49 GMT 2010
A little while ago in this mailing list I asked how I should implement
Passing null for 'arguments' to queueBind()
I believe I came up with a solution that works without the use of a custom
exchange type. I would like your feedback on my design.
I loosely define message privacy as follows:
1. Message is addressed to a subset of consumers
2. Only group members receive the message
3. It must be sufficiently hard for non-group members to receive the message
4. Group membership may change over time
Here's my design.
1. One producer, many consumers.
2. Producer authenticates consumers (using means external to RabbitMQ), so
Producer knows the identity of each consumer.
3. We use a headers exchange. We name it: "ex.privacy".
4. All consumers use a single user account (say, "consumer") with
permissions like this:
1. Configure: "q\\..*"
2. Write: ""
3. read: "q\\..*"
(Intention here is to give the consumers "configure" and "read" rights to
queues. We name all queues with the prefix "q.")
5. Producer can do anything: that is, ".*", ".*", ".*".
6. Consumers declare their own queues, with auto-delete set to true.
7. Producer binds queues on behalf of consumers. Note, because of their
permission setting, consumers are prevented from binding their queues.
8. Producer binds a queue with two items in the header: 1) constant flag for
public message, say "PUBLIC", 2) ID for the particular consumer. We use
"any" matching algorithm.
9. Public messages are sent with the constant flag "PUBLIC" in the header.
10. Private messages are sent with the list of IDs (of the target consumers)
in the header.
Note: I let consumer declare their queues (Step #6 above). When auto-delete
is correctly set, this ensures queue deletion upon connection termination.
View this message in context: http://old.nabble.com/Private-messages-tp30539657p30539657.html
Sent from the RabbitMQ mailing list archive at Nabble.com.
More information about the rabbitmq-discuss