Issue with # wildcard character in Routing key for Topic Exchange

866 views
Skip to first unread message

Kannan Sankaran

unread,
Aug 10, 2022, 3:40:50 AM8/10/22
to rabbitm...@googlegroups.com
Hello,

We are using Rabbit MQ V3.10.5

We are trying to set permission for multiple routing key patterns for an user against our Topic Exchange. We are using '.#' wildcard character at the end for each of the routing key patterns. The reference curl command used to set this permission is below:

curl -k -s -u rmadmin:xyz -X PUT https://localhost:15671/api/topic-permissions/MainVhost/TestAMQP -H "content-type: application/json" -d "{""exchange"":""MainExchange"",""write"":""(TAdapter.*.Response.#|QAdapter.*.Response.#)"",""read"":""(T.*.Response.#|Q.*.Response.#)""}"

The permission is set correctly as above and visible in management console.


When we are trying to publish a message to the exchange with a routing key ending with some characters in Lieu of the # (example:  TAdapter.abc.Response.xyz) , it gives an Access refused error. However we are able to publish a message only when the routing key value is given ending with '.#' (example: TAdapter.abc.Response.#) So it is working only for an exact match and # is not being treated as a wildcard pattern.

What could be the possible issue here? Is there any issue in the syntax or format while assigning the permission? Or is there any escape character to be specified for # while defining the permission using json in curl command?

Thanks

Best regards

Luke Bakken

unread,
Aug 10, 2022, 11:34:30 AM8/10/22
to rabbitmq-users
Hello,

It turns out we could improve the documentation for this. Here is the only place where I saw examples of how to use wildcards for topic permissions:


Note that you should use the * (asterisk) character.

Thanks,
Luke

Reply all
Reply to author
Forward
0 new messages