org.objectweb.joram.mom.amqp
Class HeadersExchange
java.lang.Object
fr.dyade.aaa.agent.Agent
org.objectweb.joram.mom.amqp.ExchangeAgent
org.objectweb.joram.mom.amqp.HeadersExchange
- All Implemented Interfaces:
- fr.dyade.aaa.agent.AgentMBean, java.io.Serializable
public class HeadersExchange
- extends ExchangeAgent
The headers exchange type works as follows:
- 1. A message queue is bound to the exchange with a table of arguments
containing the headers to be matched for that binding and optionally the
values they should hold. The routing key is not used.
- 2. A publisher sends a message to the exchange where the 'headers'
property contains a table of names and values.
- 3. The message is passed to the queue if the headers property matches the
arguments with which the queue was bound.
The matching algorithm is controlled by a special bind argument passed as a
name value pair in the arguments table. The name of this argument is
'xmatch'.
It can take one of two values, dictating how the rest of the name value pairs
in the table are treated during matching:
- (i) 'all' implies that all the other pairs must match the headers
property of a message for that message to be routed (i.e. and AND match)
- (ii) 'any' implies that the message should be routed if any of the fields
in the headers property match one of the fields in the arguments table (i.e.
an OR match)
A field in the bind arguments matches a field in the message if either the
field in the bind arguments has no value and a field of the same name is
present in the message headers or if the field in the bind arguments has a
value and a field of the same name exists in the message headers and has that
same value.
- See Also:
- Serialized Form
Fields inherited from class fr.dyade.aaa.agent.Agent |
fixed, logmon, nullName |
Constructor Summary |
HeadersExchange(java.lang.String name,
boolean durable)
|
Method Summary |
void |
bind(java.lang.String queue,
java.lang.String routingKey,
java.util.Map arguments)
|
void |
doReact(fr.dyade.aaa.agent.UnknownAgent not)
|
boolean |
isUnused()
|
void |
publish(java.lang.String exchange,
java.lang.String routingKey,
AMQP.Basic.BasicProperties properties,
byte[] body)
|
void |
setArguments(java.util.Map arguments)
|
void |
unbind(java.lang.String queue,
java.lang.String routingKey,
java.util.Map arguments)
|
Methods inherited from class fr.dyade.aaa.agent.Agent |
agentFinalize, delete, delete, deploy, deploy, getAgentId, getId, getLogTopic, getName, isDeployed, isFixed, needToBeCommited, save, sendTo, sendTo, sendTo, setName, setNoSave, setSave, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
HeadersExchange
public HeadersExchange(java.lang.String name,
boolean durable)
bind
public void bind(java.lang.String queue,
java.lang.String routingKey,
java.util.Map arguments)
- Specified by:
bind
in class ExchangeAgent
unbind
public void unbind(java.lang.String queue,
java.lang.String routingKey,
java.util.Map arguments)
- Specified by:
unbind
in class ExchangeAgent
publish
public void publish(java.lang.String exchange,
java.lang.String routingKey,
AMQP.Basic.BasicProperties properties,
byte[] body)
- Specified by:
publish
in class ExchangeAgent
setArguments
public void setArguments(java.util.Map arguments)
- Specified by:
setArguments
in class ExchangeAgent
doReact
public void doReact(fr.dyade.aaa.agent.UnknownAgent not)
- Specified by:
doReact
in class ExchangeAgent
isUnused
public boolean isUnused()
- Specified by:
isUnused
in class ExchangeAgent
Copyright © 2005 Scalagent - All rights reserved