Using com.rabbitmq.client with AMQP version 0.9.1 I am doing the following to declare a durable headers exchange, declare a durable queue, and bind the queue to the exchange with headers.
channel.exchangeDeclare("myExchange", "headers", true);
channel.queueDeclare("myQueue", true, false, false, null);
Map<String, Object> bindingArgs = new HashMap<String, Object>();
bindingArgs.put("x-match", "any"); //any or all
bindingArgs.put("headerName1", "headerValue1");
channel.queueBind("myQueue", "myExchange", "", bindingArgs);
If I run the same code again, but with a different header name/value I am effectively adding another header to the queue on the broker (not replacing the previous one).
i.e.
...
bindingArgs.put("headerName2", "headerValue2");
...
Is there a way with the java rabbitmq client to get all of the bound headers for a queue from the broker?
This would return something like:
"headerName1" : "headerValue1"
"headerName2" : "headerValue2"