REQUIREMENT mime.plugin.accessfilter |
Type | NEW |
Priority | HIGH |
Status | CLOSED |
Topic | XmlBlaster has a MIME based plugin interface to filter message access |
Des cription |
XmlBlaster allows you to query topics based on their meta information with XPath. Sometimes this is not enough. The key-meta information for one topic (say oid="Track") is immutable. Putting dynamic data into the topic meta information is not supported as implementing it has impact on performance. Distributing thousand messages / second under different topics is memory consuming. This is a use case where you may want to write a little plugin, doing some query in the message content (it is like a full text search). Please study the following illustration which shows this use case. All airplanes are sending their GPS track coordinates every 5 seconds. If you track 5000 airplanes you have 1000 messages/second. Performance is a real challenge here. Air traffic controllers want to zoom into special geographic areas and need to subscribe to only those airplanes which are in their latitude and longitude range. An air traffic controller subscribes to the message oid="Track". Other messages won't be delivered. It is a normal subscription. Now his software adds a filter rule, which is evaluated on each track message by your plugin. As a plugin coder, you have to implement two interfaces
Filter Features:
|
Example Java |
These is an example key and QoS of a subscribe() invocation: <key oid='' queryType='XPATH'> //StockData </key> <qos> <filter type='ContentLenFilter'> 8000 </filter> <filter type='ContainsChecker' version='7.1'> sex </filter> </qos>
All messages containing the xml meta information element <StockData/> are
selected. The topic of the message below contains the topic meta information <StockData/> and is therefore subscribed, but it is filtered away as it contains the word sex: <publish> <key oid="MyMessage"><StockData/></key> <content>Enhance your sex ...</content> <qos><persistent/></qos> </publish> Note that some filter plugins check the qos settings of the message, others check the content of a message Don't forget to put your query string in a <![CDATA[ ... ]]> section if you use "<" in your query string. |
Configure |
For coding and configuration of plugins please read the requirement mime.plugin.access.howto (see link below)
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.engine.mime.I_AccessFilter |
See API | org.xmlBlaster.engine.mime.demo.ContentLenFilter |
See API | org.xmlBlaster.util.plugin.I_Plugin |
See REQ | mime.plugin.accessfilter.howto |
See REQ | mime.plugin.access.regex |
See REQ | mime.plugin.access.sql92 |
See REQ | mime.plugin.access.xpath |
See REQ | util.property.env |
See REQ | mime.plugin.publishfilter |
See TEST | org.xmlBlaster.test.mime.TestSubscribeFilter |
See TEST | org.xmlBlaster.test.mime.TestGetFilter |
This page is generated from the requirement XML file xmlBlaster/doc/requirements/mime.plugin.accessfilter.xml