[rabbitmq-discuss] Regex field validation as per Amqp spec

Emile Joubert emile at rabbitmq.com
Thu Oct 6 11:35:57 BST 2011

Hi Robin,

On 05/10/11 15:02, Robin Harvey wrote:
> (https://github.com/videlalvaro/Thumper), the RPC client uses an
> auto-generated queue name for the response queue (from
> queue.declare-ok), these look something like this:
> amq.gen-IuK1REOUDF8MxpANaTQWXQ==
> However, when I pass this to the basic.consume, my library complains
> that this breaks validation of the amqp "queue-name" domain, which has
> the following regex validation rule:
> ^[a-zA-Z0-9-_.:]*$

This expression won't match queues that are auto-generated by rabbit.
Queue names are "shortstr" in the AMQP 0-9-1 spec, which says:

Short strings, stored as an 8-bit unsigned integer length followed by
zero or more octets of data. Short strings can carry up to 255 octets of
UTF-8 data, but may not contain binary zero octets.

I see little need for validation beyond checking of length. You can
probably ignore validation errors from your library. You might even
request that the library author relax the validation, depending on what
that validation is attempting to achieve.


More information about the rabbitmq-discuss mailing list