Brett Janer : you are right.
I'm sorry but once again, it is just a fact that all argument's key of any binding in a headers exchange starting by "x-" other than "x-match" is just NOT taken into account, point.
It is definitively coded that way :
<<
| % Delete bindings starting with x- | headers_match([{<<"x-", _/binary>>, _PT, _PV} | PRest], Data, | |
| AllMatch, AnyMatch, MatchKind) -> |
headers_match(PRest, Data, AllMatch, AnyMatch, MatchKind); |
|
>>
(I know that, I worked on it !)
If you are not convinced yet, please do a real test by yourself :
* take the latest RabbitMQ's version on Docker (3.7.14 now)
* create a queue "q1"
* in some headers exchange, create a simple binding with only 1 argument's key "x-foo" with value "bar" linked to q1 (x-match will default to "all" type)
* in that same exchange, just publish a message with an argument's key "x-foo" with value "NOTBAR at all but alors pas du tout !"
* and please look at the simple fact that your message is.. routed
But this is not a "bug", this comes from AMQP specs dealing with argument's keys starting by "x-" which are "reserved for future use" : it is an historic implementation, which I can totally understand !
So yes, as I said before when I wrote that it << can't be matched >>, it just cannot be :)
SylvainHH.