|
REQUIREMENT engine.qos.publish.destination.PtP |
| Type | NEW |
| Priority | HIGH |
| Status | CLOSED |
| Topic | PtP (Point to Point) messages are routed using the qos-destination tag | ||||||||||||||||
|
Des cription |
If you specify a <destination> tag when publishing a message, the message will be delivered to the given address. The address must follow this naming schema:
The following table shows the routing chosen for different address types:
You may use as many destination addresses as you wish in a publish QoS. |
||||||||||||||||
|
Example XML |
<-- Publish QoS to send a message to 'Gesa', 'Tim' and 'Ben' -->
<qos>
<destination>
Gesa
</destination>
<destination queryType='EXACT'>
Tim/-5
</destination>
<destination queryType='EXACT' forceQueuing='true'>
/node/heron/client/Ben/-2
</destination>
</qos>";
|
||||||||||||||||
|
Example Java |
import org.xmlBlaster.util.Global;
import org.xmlBlaster.util.XmlBlasterException;
import org.xmlBlaster.util.SessionName;
import org.xmlBlaster.client.key.PublishKey;
import org.xmlBlaster.client.qos.PublishQos;
import org.xmlBlaster.client.qos.PublishReturnQos;
import org.xmlBlaster.util.qos.address.Destination;
// connect to xmlBlaster (not shown here) ...
try {
// Send a message to 'Gesa', 'Tim' and 'Ben' ...
PublishKey pk = new PublishKey(glob, "Dinner");
PublishQos pq = new PublishQos(glob);
pq.addDestination(new Destination(new SessionName(glob, "Gesa")));
pq.addDestination(new Destination(new SessionName(glob, "Tim/-5")));
Destination destination = new Destination(
new SessionName(glob, "/node/heron/client/Ben/-2"));
destination.forceQueuing(true);
pq.addDestination(destination);
String content = "Dinner is ready";
MsgUnit msgUnit = new MsgUnit(pk, content, pq);
PublishReturnQos rq = connection.publish(msgUnit);
System.out.println("Published PtP message: " + rq.toXml());
}
catch(XmlBlasterException e) {
System.err.println(e.getMessage());
}
|
||||||||||||||||
| Configure |
NOTE: Configuration parameters are specified on command line (-someValue 17) or in the
xmlBlaster.properties file (someValue=17). See requirement "util.property" for details. |
||||||||||||||||
| See REQ | engine.qos.publish.destination.ForceQueuing | ||||||||||||||||
| See REQ | engine.qos.publish.destination.offline | ||||||||||||||||
| See REQ | engine.qos.publish.destination.PtX | ||||||||||||||||
| See REQ | cluster.PtP | ||||||||||||||||
| See REQ | interface.publish | ||||||||||||||||
| See API | org.xmlBlaster.client.qos.PublishQos | ||||||||||||||||
| See API | org.xmlBlaster.client.key.PublishKey | ||||||||||||||||
| See API | HelloWorld5 | ||||||||||||||||
| See TEST | org.xmlBlaster.test.qos.TestPtD | ||||||||||||||||
| See TEST | org.xmlBlaster.test.qos.TestPtSession | ||||||||||||||||
| See TEST | org.xmlBlaster.test.cluster.PtPTest |
This page is generated from the requirement XML file xmlBlaster/doc/requirements/engine.qos.publish.destination.PtP.xml