XmlBlaster Logo

REQUIREMENT

engine.qos.clientProperty

XmlBlaster Logo


Type NEW
Priority LOW
Status CLOSED
Topic A generic qos subtag permitting to pass client specific parameters to other clients or to plugins
Des
cription

In some cases the fixed tags offered by the different qos are not sufficient to cover all specific needs a client has. For example a client wants to send a message to another client and wants to add to the message a correlationId besides the message content (payload). clientProperty is a generic tag so you could pass such information which otherwise would need to be passed wrapped inside the content of the message:

<qos>
   ...
   <clientProperty name='corrId' type='int'>120001</clientProperty>

   <clientProperty name='SayHello'>Hello World</clientProperty>
   
   <clientProperty name='MyXmlString' type='String' encoding='base64'>
      QmxhPEJsYUJsYQ==
   </clientProperty>
   
   <clientProperty name='myBlob' type='byte[]' encoding='base64'>
      AEEAYw==
   </clientProperty>
</qos>

The default property type is String. The String "Bla<BlaBla" contains an illegal < and is therefore automatically base64 encoded to QmxhPEJsYUJsYQ==. Binary BLOB data is base64 encoded as well.

This tag is in the following qos:

  • ConnectQos
  • DisconnectQos
  • PublishQos
  • SubscribeQos
  • UnSubscribeQos
  • GetQos
  • EraseQos
  • UpdateQos

The information you send inside this tag is not processed by the core. It could be processed by other clients (for example in the update method) or by plugins.

If no type is specified it is assumed to be a String. Other objects supported are:

  • Boolean (type='boolean')
  • Byte (type='boolean')
  • Short (type='short')
  • Integer (type='int')
  • Long (type='long')
  • Float (type='float')
  • Double (type='double')
  • Blob (type='byte[]')

Example
XML
<-- Publish QoS to send a message with a given correlationId -->

in with java:
   PublishQos publishQos = new PublishQos(global);
   publishQos.addClientProperty("correlationId", "0102203030452378");

which generates:
<qos>
   ...
   <clientProperty name='correlationId'>0102203030452378</clientProperty>
   ...
</qos>

or

   PublishQos publishQos = new PublishQos(global);
   publishQos.addClientProperty("windSpeed", new Double(1.2323));

which generates:
<qos>
   ...
   <clientProperty name='windSpeed' type='double'>1.2323</clientProperty>
   ...
</qos>

in the update method:
   String correlationId = updateQos.getClientProperty("correlationId", "");
or
   double windSpeed = updateQos.getClientProperty("windSpeed", 0.0);

The second argument is the default to use if the property is unknown.
   
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.util.qos.ClientProperty
See API org.xmlBlaster.util.qos.QosData
See API org.xmlBlaster.client.qos.ConnectQos
See API org.xmlBlaster.client.qos.UpdateQos
See API org.xmlBlaster.client.qos.DisconnectQos
See API org.xmlBlaster.client.qos.PublishQos
See API org.xmlBlaster.client.qos.SubscribeQos
See API org.xmlBlaster.client.qos.UnSubscribeQos
See API org.xmlBlaster.client.qos.GetQos
See API org.xmlBlaster.client.qos.EraseQos
See TEST org.xmlBlaster.test.qos.TestClientProperty

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

Back to overview