XmlBlaster Logo

REQUIREMENT

engine.qos.publish.destination.PtP

XmlBlaster Logo


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:


Session naming convention

The following table shows the routing chosen for different address types:

Address type Example Description Impl
subjectId joe The publisher and the receiver of the message need to be connected to the same xmlBlaster server.
If joe is logged in multiple times, all sessions of joe will receive this message.
yes
relative name client/joe/-9 or joe/-9 The publisher and the receiver of the message need to be connected to the same xmlBlaster server.
The message is delivered to login session pubSessionId=-9 of client joe only. This is typically useful for ACK messages.
yes
absolute name /node/heron/client/joe The PtP message is routed in a cluster environment to cluster node heron, the user joe is expected there.
If joe is logged in multiple times at node heron, all sessions of joe will receive this message.
If the name contains a pubSessionId the message is routed to the specific session only.
yes

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.
Columns named Impl tells you if the feature is implemented.
Columns named Hot tells you if the configuration is changeable in hot operation.

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

Back to overview