org.objectweb.joram.mom.amqp
Class TopicExchange
java.lang.Object
fr.dyade.aaa.agent.Agent
org.objectweb.joram.mom.amqp.ExchangeAgent
org.objectweb.joram.mom.amqp.TopicExchange
- All Implemented Interfaces:
- fr.dyade.aaa.agent.AgentMBean, java.io.Serializable
public class TopicExchange
- extends ExchangeAgent
The topic exchange type provides routing to bound queues based on a pattern
match between the binding key and the routing key of the message. This
exchange type may be used to support the classic publish/subscribe paradigm
using a topic namespace as the addressing model to select and deliver
messages across multiple consumers based on a partial or full match on a
topic pattern.
The topic exchange type works as follows:
- 1. A message queue is bound to the exchange using a binding key, K.
- 2. A publisher sends the exchange a message with the routing key R.
- 3. The message is passed to the all message queues where K matches R.
The binding key is formed using zero or more tokens, with each token
delimited by the '.' char. The binding key MUST be specified in this form and
additionally supports special wild-card characters: '*' matches a single word
and '#' matches zero or more words.
Thus the binding key "*.stock.#" matches the routing keys "usd.stock" and
"eur.stock.db" but not "stock.nasdaq".
- See Also:
- Serialized Form
Fields inherited from class fr.dyade.aaa.agent.Agent |
fixed, logmon, nullName |
Constructor Summary |
TopicExchange(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 |
TopicExchange
public TopicExchange(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 © 2000 - 2009 Scalagent D.T. - All rights reserved