[rabbitmq-discuss] Exchanges, Routing, and AMQP

Ben Hood 0x6e6562 at gmail.com
Sat Nov 8 20:15:15 GMT 2008


Peter,

On Sat, Nov 8, 2008 at 7:29 PM, Peter Silva <Peter.A.Silva at gmail.com> wrote:
> That's strange... maybe I'm just getting confused by
> a client code... Here is an example from the demo in py-amqplib...
>
>  ch.basic_publish(msg, EXCHANGE_NAME, routing_key=topic)
>
> the 'routing_key' in this api, afaict, is one of three keywords: topic,
> fanout, direct.   what is called exchange_type in the AMQP spec.

Are you referring to amqp_clock.py?

If so, I think that the topic is a the name of a string variable:

TOPIC_PATTERN = '%Y.%m.%d.%w.%H.%M' # Python datetime.strftime() pattern
.....
topic = now.strftime(TOPIC_PATTERN)
ch.basic_publish(msg, EXCHANGE_NAME, routing_key=topic)

> If the key is a string, and the exchange_type is opaque to the producers,
> then that's cool.  So for my application.  An admin creates the exchange,
> the producers post to it using AHL's or file names as routing keys,
> oblivious to the routing method in use.
> That's OK?

Yes, that will work.

> The next thing is that I need to be able to define routing to output queues
> myself, (how the routing key is interpreted.) before the clients apply their
> routing info, so I can say, no... my client talibanitravel.com has no access
> to the weather ob from Kandahar airport, even if they say they want it.
> They are perhaps allowed the ob from Peshawar, Moscow and Montreal.   So
> data posted on the same exchange may or may not be allowed to be seen by
> some clients.   I do that today with routing tables, others would use acl's
> or capabilities.   per exchange permissions of some sort would work... do
> they exist?

No, there is no fine grained access restriction (as discussed in other
threads on this list).

> I guess that is a function outside of AMQP (not a protocol thing, but rather
> a broker function?)

Could be - again, a mechanism orthogonal to the protocol has been discussed.

>  I get the impression permissions/ACL's
> were something applied at the queue/exchange level.  Was there
> something granular enough to apply to individual messages sent to an
> exchange blocking posting to queues based on routing_key?

AFAIK something as fine grained as this has not yet been investigated in detail.

Ben




More information about the rabbitmq-discuss mailing list