qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Permissible characters in exchange names?
Date Tue, 02 Nov 2010 21:59:14 GMT
On 11/02/2010 09:32 PM, Wolgemuth Greg wrote:
> Just encountered an incongruity when working with the QPID messaging API
> in Python. Using the C++ example "drain" program, I can easily declare
> an exchange with an address string like so:
>
> "my.exchange/subject ; { create: always, node: {type: topic, x-declare: {exchange: my.exchange,
type: direct}}}"
>
> When I try the same thing with the Python API, I get an error message
> from the parser claiming it expected a comma or right-bracket - claiming
> the "." in "my.exchange" as the problematic character.

You can fix that error by quoting the exchange name:

"my.exchange/subject ; { create: always, node: {type: topic, x-declare: 
{exchange: 'my.exchange', type: direct}}}"

> When I looked at the AMQP 0-10 specification, it seemed to state that an
> exchange name could be "any combination of digits, letters and
> underscores" Which is, of course violated by exchanges like "amq.topic"
> but I suppose that's ignored because there's no command message required
> to generate those, so it's not against the rules.
>
> Am I correct in assuming that there's a bug in the C++ implementation
> (which is too permissive and allows forbidden characters), and change my
> exchange names to match the "[A-Za-z0-9_]+" regex?

The c++ broker does not enforce the domain restrictions for exchange 
name. It prevents using names that begin with 'amq.' (as per the 
'reserved-names' exception), but other than that it allows you to use 
any characters you like.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message