org.apache.qpid.server.exchange
Class HeadersExchange
java.lang.Object
org.apache.qpid.server.exchange.AbstractExchange
org.apache.qpid.server.exchange.HeadersExchange
- All Implemented Interfaces:
- Exchange, Managable
public class HeadersExchange
- extends AbstractExchange
An exchange that binds queues based on a set of required headers and header values
and routes messages to these queues by matching the headers of the message against
those with which the queues were bound.
The Headers Exchange
Routes messages according to the value/presence of fields in the message header table.
(Basic and JMS content has a content header field called "headers" that is a table of
message header fields).
class = "headers"
routing key is not used
Has the following binding arguments:
the X-match field - if "all", does an AND match (used for GRM), if "any", does an OR match.
other fields prefixed with "X-" are ignored (and generate a console warning message).
a field with no value or empty value indicates a match on presence only.
a field with a value indicates match on field presence and specific value.
Standard instances:
amq.match - pub/sub on field content/value
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
HeadersExchange
public HeadersExchange()
registerQueue
public void registerQueue(java.lang.String routingKey,
AMQQueue queue,
org.apache.qpid.framing.FieldTable args)
throws org.apache.qpid.AMQException
- Throws:
org.apache.qpid.AMQException
deregisterQueue
public void deregisterQueue(java.lang.String routingKey,
AMQQueue queue)
throws org.apache.qpid.AMQException
- Throws:
org.apache.qpid.AMQException
route
public void route(AMQMessage payload)
throws org.apache.qpid.AMQException
- Throws:
org.apache.qpid.AMQException
getHeaders
protected java.util.Map getHeaders(org.apache.qpid.framing.ContentHeaderBody contentHeaderFrame)
createMBean
protected AbstractExchange.ExchangeMBean createMBean()
throws org.apache.qpid.AMQException
- Description copied from class:
AbstractExchange
- Concrete exchanges must implement this method in order to create the managed representation. This is
called during initialisation (template method pattern).
- Specified by:
createMBean
in class AbstractExchange
- Returns:
- the MBean
- Throws:
org.apache.qpid.AMQException