An individual binding between an exchange and a queue. The props part of the URI is a "name" for the binding composed of its routing key and a hash of its arguments. props is the field named "properties_key" from a bindings listing response.
The following snippet describes the actual hash algorithm:
I do not write Erlang, let me know if I am grabbing the wrong blocks
Suggested fixes:
Instead of using self.http_check_states.get(self.api_result.status_code, False), retrieve all bindings via /api/bindings/vhost/e/exchange/q/queue and check if the resource exists,
Use the same method to create the properties_key and place it in URL when invoking /api/bindings/vhost/e/exchange/q/queue/props
SUMMARY
When a binding is created, it will calculate the
properties_key
based on therouting_key
andarguments
:When rabbitmq_binding checks if the resource exists, it invokes the following request:
The logic does not consider
arguments
. As a result, bindings with arguments will not have idempotency and will introduce some incorrect behavior.The check uses the HTTP API /api/bindings/vhost/e/exchange/q/queue/props, which describes as below:
The following snippet describes the actual hash algorithm:
Suggested fixes:
self.http_check_states.get(self.api_result.status_code, False)
, retrieve all bindings via/api/bindings/vhost/e/exchange/q/queue
and check if the resource exists,properties_key
and place it in URL when invoking/api/bindings/vhost/e/exchange/q/queue/props
ISSUE TYPE
COMPONENT NAME
community.rabbitmq.rabbitmq_binding
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
Omitted
OS / ENVIRONMENT
OS: Ubuntu 22.04.3 LTS Kernel: 5.15.0-76-generic RabbitMQ: 3.9.13-1ubuntu0.22.04.1 (current latest release with Ubuntu 22.04)
STEPS TO REPRODUCE
Run the following tasks at least once:
EXPECTED RESULTS
After the first run, all consecutive runs should report
ok: [...]
instead ofchanged: [...]
ACTUAL RESULTS
Invoke the HTTP API and see the properties_key:
curl -u guest -s http://localhost:15672/api/bindings/%2F/e/xexchange/q/xqueue | jq