// Create session
Session session = con.createSession(0);
// declare and bind queues
session.queueDeclare("headers_queue_any", null, null);
session.queueDeclare("headers_queue_all", null, null);
// we need to declare the header: name, type, alternate exchange
session.exchangeDeclare("test.headers", "headers", "amq.direct", null);
// The matching algorithm is controlled by 'x-match' property
// 'x-match' can take one of two values,
// (i) 'all' implies that all the other pairs must match the headers