XmlBlaster Logo

REQUIREMENT

client.subscribe.dispatch

XmlBlaster Logo


Type NEW
Priority LOW
Status CLOSED
Topic I_XmlBlasterAccess is the Java client side interface to xmlBlaster which supports a subscribe variant, allowing to dispatch callback messages to dedicated update methods.
Des
cription

In I_XmlBlasterAccess.java there is a subscribe() variant with an I_Callback argument. This way you can specify for every subscription another callback handling method.

Having only one central update() method, forced you to look into the received message to decide what to do with it. Now on subscription the messages are dispatched to the corresponding update().

Example
Java
      
      ...

      // login:
      I_XmlBlasterAccess con = glob.getXmlBlasterAccess();
      con.connect(connectQos, this);

      ...

      // subscribe with an anonymous update() method only for this subscription
      con.subscribe(key.toXml(), qos.toXml(), new I_Callback() {

            public void update(String name, UpdateKey updateKey, byte[] content,
                               UpdateQos updateQos) {
               Log.info(ME, "Receiving message with specialized update() ...");
            }
         });
      
   
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.TestSubDispatch

This page is generated from the requirement XML file xmlBlaster/doc/requirements/client.subscribe.dispatch.xml

Back to overview