Horner, John wrote:
We have cases where multiple, different subscriptions will match the same message. We would like to avoid multiple deliveries to the same client in cases like this. I've seen the options which allow you to specify a single delivery for multiple, identical subscriptions, but don't see anything for multiple, different subscriptions. Is there any configuration option that lets me do this?
A complicating factor is that we still need to know all of the subscriptions a 
message matched, even though we would prefer it was only delivered once.

On the assumption that there isn't already a way to do this, my follow-up 
question is: How crazy is it for me to try to make this change?  I was looking 
at TopicHandler.invokeCallbackAndHandleFailure() and wondering if I could 
replace the call to getSubscriptionInfoArr() with a routine to weed out 
multiple subscriptions to the same client.  I would also have to monkey with 
the wrapper created in invokeCallback() so that the information about the 
multiple subscriptions is built into the message before going into the message 
queue.  I shouldn't try this, right?
Hi John,

if i understand you correctly you want to reach the message max once PER CLIENT.

The simplest solution is to write a mime plugin which decides if a messages is put to the callback
queue of a specific client:

http://www.xmlblaster.org/xmlBlaster/doc/requirements/mime.plugin.accessfilter.html

In the http://www.xmlblaster.org/xmlBlaster/doc/api/org/xmlBlaster/engine/mime/I_AccessFilter.html

|boolean| |*match <http://www.xmlblaster.org/xmlBlaster/doc/api/org/xmlBlaster/engine/mime/I_AccessFilter.html#match%28org.xmlBlaster.authentication.SessionInfo,%20org.xmlBlaster.util.MsgUnit,%20org.xmlBlaster.engine.mime.Query%29>*(SessionInfo <http://www.xmlblaster.org/xmlBlaster/doc/api/org/xmlBlaster/authentication/SessionInfo.html> receiver, MsgUnit <http://www.xmlblaster.org/xmlBlaster/doc/api/org/xmlBlaster/util/MsgUnit.html> msgUnit, Query <http://www.xmlblaster.org/xmlBlaster/doc/api/org/xmlBlaster/engine/mime/Query.html> query)|

method you only need to remember the last rcvTimestamp (of the PublishQos, it is the unqiue identifier and strict monotonous ascending) and discard any message which has the same timestamp (or older which shouldn't happen).

Note that all subscribers need to use the mime plugin (configured in their SubscribeQos).

regards
Marcel
Thanks,
John Horner

Open Roads Consulting
(757) 546-3401
www.openroadsconsulting.com






--
Marcel Ruff
http://www.xmlBlaster.org
http://watchee.net
Phone: +49 7551 309371

Reply via email to