XmlBlaster Logo

REQUIREMENT

engine.qos.subscribe.duplicate

XmlBlaster Logo


Type NEW
Priority LOW
Status CLOSED
Topic On connection a client can specify to not receive duplicate messages even when he has subscribed multiple times.
Des
cription

If you set on connect

<qos> 
   ...
   <duplicateUpdates>false</duplicateUpdates>
</qos>
     

and later subscribe multiple times on the same message oid xmlBlaster will update the message to you once only.
Subscribing multiple times can be by purpose or by coincidence for example with different XPath subscriptions matching the same message oid.

Note that the second/third ... subscription will not return an initial update any more.

The returned subscription ID is identical for identical subscribes. Note that you have to call unSubscribe() as often as you have subscribed before to get really rid of updates.

Example
Java
      
...

// login:
try {
   con = glob.getXmlBlasterAccess();

   ConnectQos qos = new ConnectQos(glob);

   qos.setDuplicateUpdates(false);  // Suppress duplicate updates

   con.connect(qos, this);

   String subId1 = con.subscribe("<key oid='radar-track'/>, null);

   String subId2 = con.subscribe("<key oid='radar-track'/>, null);

   // subId1 and subId2 are identical

   con.unSubscribe("<key oid='" + subId1 + "'/>", null);

   con.unSubscribe("<key oid='" + subId2 + "'/>", null);
}
catch (Exception e) {
      log.error(ME, "Login failed: " + e.toString());
}
...
      
   
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 API org.xmlBlaster.client.I_XmlBlasterAccess
See TEST org.xmlBlaster.test.qos.TestSubNoDup

This page is generated from the requirement XML file xmlBlaster/doc/requirements/engine.qos.subscribe.duplicate.xml

Back to overview