[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster-devel] XPath subscriptions



inEvo wrote:
Ok,

I did as you said and i was able to receive the messages but now the problem is i receive to many!

As said before, the topic meta information is immutable, your changed key attribute "test2" is sent to the same topic 'SimpleChat' and has no effect.

If you want to filter each message instance of a identical
topic oid (here oid='SimpleChat') you need to use QoS filters.
We deliver three kinds of filters: XPATH, 'regular expression'
and 'SQL 92 where conditions',
see:

http://www.xmlblaster.org/xmlBlaster/doc/requirements/mime.plugin.access.xpath.html
http://www.xmlblaster.org/xmlBlaster/doc/requirements/mime.plugin.access.sql92.html
http://www.xmlblaster.org/xmlBlaster/doc/requirements/mime.plugin.access.regex.html

You can add your own filter plugin if the three delivered are
not good enough,

regards
Marcel



>s test1

Subscribing topic test1
Subscribed key :
<key queryType='XPATH'>
 /xmlBlaster/key/SimpleChat[ at canal='test1']
</key>

Here i subscribed to a xpath key

Then i publish a message with that same key:

 >test1 hello

Publishing :
 <key oid='SimpleChat'>
   <SimpleChat canal='test1'/>
 </key>
  <content><![CDATA[ hello]]></content>
 <qos>
  <isPublish/>
 </qos>

Got the message as expected:

Message from SoEu
<SimpleChat canal='test1'></SimpleChat> hello

The problem is when i publish a message with a different canal attribute, like this:

 >test2 hello

Publishing :
 <key oid='SimpleChat'>
   <SimpleChat canal='test2'/>
 </key>
  <content><![CDATA[ hello]]></content>
 <qos>
  <isPublish/>
 </qos>

I receive the message even without having subscribe to messages with canal set to 'test2'!

Message from SoEu
<SimpleChat canal='test2'></SimpleChat> hello

I'm a doing something wrong here?!

Regards,

   Nelson Silva


Marcel Ruff wrote:

inEvo wrote:

Hi,

Is there a way to dispose of topics stored in the dabase?!



A call to erase() does it. erase has some QoS to control if pending messages of this topic in callback queues are still delivered or are disposed as well.


Also is there a way to use a single xmlBlaster for multiple sessions, that is to say... Let's imagine i have a topic called 'test"


A user would login to a given session of the xmlBlaster server, and all those in the same session, if they had subscribed to the 'test' topic would receive the message. Still, another user could login to the xmlBlaster, in a diferrent session, and subscribe to the same 'test' topic, but all messages published by users in the first session would not be received by him.



If somebody subscribes to 'test' he will get all messages published to it,
a topic is not bound to a session or a session group.
But you can use filtering with client tags to
do what you want.


regards
Marcel




Does something like this exist or do i have to use some client tags for this?


Regards,

Nelson

Marcel Ruff wrote:

Hi,

this runs fine here:

  java org.xmlBlaster.Main

java javaclients.HelloWorldSubscribe -xpath "/xmlBlaster/key/SimpleChat[ at canal='hello']"

java javaclients.HelloWorldPublish -oid SimpleChat -clientTags "<SimpleChat canal='hello'/>" -numPublish 10


Note that the very first publish sets the immutable meta information of the topic (you SimpleChat tag).

Further publishes won't change this meta information.

It could be possible that your topic existed already wihtout
the 'canal' attribute from some former tests you made.
Have a look into the xmlBlaster dump in the <XmlKeyDom> section.

Please try to delete your persistence store
(remove all in $HOME/tmp/* or ${user.home}${file.separator}tmp
if you use HSQLDB) and restart xmlBlaster.

regards,
Marcel



inEvo wrote:

Hi,

I'm currently having a few problems with XPath subscription...

If i subscribe with a key like :

<key queryType='XPATH'>
 /xmlBlaster/key/SimpleChat
</key>

then .. if i publish :

<key oid='SimpleChat'>
   <SimpleChat canal='hello'>
</SimpleChat>
 </key>
  <content><![CDATA[test]]></content>
 <qos>
  <isPublish/>
 </qos>

everything works.. but if i had subscribed with a key like: /xmlBlaster/key/SimpleChat[ at canal='hello']
i would have not received the message!! Am i missing something here?!


I can subscribe to topics using /xmlBlaster/key[ at oid='SimpleChat'] so what's the problem here?!

Any help will be greatly appreciated.

Regards,

   Nelson Silva













--
http://www.xmlBlaster.org