gmr/pamqp

Unable to create queue with name containing semi column

Closed this issue · 1 comments

Hello,

Thanks for the library. Most of our queues are called with semi-column in their names which seems not possible looking at the regex in constants.py.

DOMAIN_REGEX = {
    'exchange-name': re.compile(r'^[a-zA-Z0-9-_.:]*$'),
    'queue-name': re.compile(r'^[a-zA-Z0-9-_.:;]*$')
}

We're currently pika which does not have this limitation. Is there any reason about it?

I'd be glad to contribute to do this if you want.

gmr commented

These values come from the AMQP spec and the code is auto-generated:

From https://www.rabbitmq.com/resources/specs/amqp0-9-1.extended.xml

<domain name="exchange-name" type="shortstr" label="exchange name">
  <doc>
  The exchange name is a client-selected string that identifies the exchange for publish methods.
  </doc>
  <assert check="length" value="127"/>
  <assert check="regexp" value="^[a-zA-Z0-9-_.:]*$"/>
</domain>
<domain name="queue-name" type="shortstr" label="queue name">
  <doc>
    The queue name identifies the queue within the vhost. In methods where the queue name may be blank, and that has no specific significance, this refers to the 'current' queue for the channel, meaning the last queue that the client declared on the channel. If the client did not declare a queue, and the method needs a queue name, this will result in a 502 (syntax error) channel exception.
  </doc>
  <assert check="length" value="127"/>
  <assert check="regexp" value="^[a-zA-Z0-9-_.:]*$"/>
</domain>