REQUIREMENT engine.qos.subscribe.multiSubscribe |
Type | NEW |
Priority | LOW |
Status | CLOSED |
Topic | On multiple subscription on the same topic a client can specify to receive this message only once. |
Des cription |
If you subscribe with the same client (the same login session) multiple times to the same message you will receive this message multiple times, one update for each subscription. Sometimes you may want to ignore multiple subscriptions. If you set on subscribe <qos> ... <multiSubscribe>false</multiSubscribe> </qos>
If you subscribe with an XPath query, only the query string will be checked to be identical. In the case that an XPath subscription (with different query syntax) hits an already subscribed topic you will receive the topic twice.
The returned subscription ID is identical for identical subscribes,
additionally the returned
If your SubscribeQos contains access filter rules
(see requirement mime.plugin.accessfilter)
and you have set |
Example Java |
import org.xmlBlaster.client.I_XmlBlasterAccess; import org.xmlBlaster.client.qos.ConnectQos; import org.xmlBlaster.client.qos.SubscribeQos; import org.xmlBlaster.client.qos.SubscribeReturnQos; ... try { con = glob.getXmlBlasterAccess(); ConnectQos qos = new ConnectQos(glob); con.connect(qos, this); SubscribeQos subQos = new SubscribeQos(glob); subQos.setMultiSubscribe(false); SubscribeReturnQos subId1 = con.subscribe("<key oid='radar-track'/>", subQos.toXml()); SubscribeReturnQos subId2 = con.subscribe("<key oid='radar-track'/>", subQos.toXml()); System.out.println("Got subscribe receipt: state=" + subId1.getState() + " subscriptionId=" + subId1.getSubscriptionId()); // only one message is updated if the topic 'radar-track' is published // subId1 and subId2 are identical, one unSubscribe is enough: con.unSubscribe("<key oid='" + subId1 + "'/>", 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. |
See API | org.xmlBlaster.client.I_XmlBlasterAccess |
See TEST | org.xmlBlaster.test.qos.TestSubMultiSubscribe |
This page is generated from the requirement XML file xmlBlaster/doc/requirements/engine.qos.subscribe.multiSubscribe.xml