When a destination is created with a wildcard, it may not have the correct policy applied.
For example, if there are two policies:
and if the queue test.queue.> is created, the policy for test.queue.a will be applied to that destination instead of the test.queue.> policy.
Some work was done on this in
AMQ-5972 and that seems to have fixed most of the issues, but there is this one edge case where we need to account for what happens if a policy matches a destination exactly.