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

Re: [xmlblaster] xmlBlaster with perl questions



Kevin Priebe wrote:
Hi,

I've recently started to experiment with xmlBlaster using the Perl
interface.  Basically what we want to have is an event queueing/batching
system where events are generated and sent to xmlBlaster.  Some events
can happen right away and some should happen only at certain time
intervals (batched together).  I have it working with an event
generator, a Q/batch system (prototype just written in house) and
several agents that subscribe to certain event types.  There are a few
things that I need to know but can't find about xmlBlaster:

1) Is there a way that an agent can ask xmlBlaster what it is subscribed
for? (agents can subscribe for more than one event type)
Currently you can query the subscriptionList, try on comman line:

======== Start server
java org.xmlBlaster.Main

======== Start a subscriber
java javaclients.HelloWorldSubscribe -session.name joe/1 -xpath //key
(type one time 'enter' to subscribe)

======== Start a telnet client and play:
~/xmlBlaster> telnet localhost 2702
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.

127.0.0.1 << connect myname secret

127.0.0.1 << get client/joe/1/?subscriptionList
get client/joe/1/?subscriptionList

  <key oid='__cmd:'/>
   <content><![CDATA[__subId:xmlBlaster_192_168_1_4_3412-XPATH9]]></content>
  <qos>
   <isGet/>
  </qos>


As you see the subscriptionId '__subId:xmlBlaster_192_168_1_4_3412-2' is returned.


This is probably not enough information for you so i have added a new administrative command 'subscriptionDump'

127.0.0.1 << get client/joe/1/?subscriptionDump
get client/joe/1/?subscriptionDump

<key oid='__cmd:'/>
<content><![CDATA[<SessionInfo id='/node/xmlBlaster_192_168_1_4_3412/client/joe/1'>
<subscription id='__subId:xmlBlaster_192_168_1_4_3412-XPATH4:5' sessionName='/node/xmlBlaster_192_168_1_4_3412/client/joe/1' oid='__sys__UserList' parent='__subId:xmlBlaster_192_168_1_4_3412-XPATH4' creationTime='Oct 13, 2004 10:52:11 AM'>
<key oid='__sys__UserList'>
<__sys__internal></__sys__internal>
</key>
<qos>
<subscribe id='__subId:xmlBlaster_192_168_1_4_3412-XPATH4'/>
<content/>
<multiSubscribe/>
<local/>
<initialUpdate/>
<updateOneway>false</updateOneway>
<notify/>
<persistent>false</persistent>
<isSubscribe/>
</qos>
</subscription>
<subscription id='__subId:xmlBlaster_192_168_1_4_3412-XPATH4:7' sessionName='/node/xmlBlaster_192_168_1_4_3412/client/joe/1' oid='__sys__Logout' parent='__subId:xmlBlaster_192_168_1_4_3412-XPATH4' creationTime='Oct 13, 2004 10:52:12 AM'>
<key oid='__sys__Logout'/>
<qos>
<subscribe id='__subId:xmlBlaster_192_168_1_4_3412-XPATH4'/>
<content/>
<multiSubscribe/>
<local/>
<initialUpdate/>
<updateOneway>false</updateOneway>
<notify/>
<persistent>false</persistent>
<isSubscribe/>
</qos>
</subscription>
<subscription id='__subId:xmlBlaster_192_168_1_4_3412-XPATH4:6' sessionName='/node/xmlBlaster_192_168_1_4_3412/client/joe/1' oid='__sys__Login' parent='__subId:xmlBlaster_192_168_1_4_3412-XPATH4' creationTime='Oct 13, 2004 10:52:12 AM'>
<key oid='__sys__Login'/>
<qos>
<subscribe id='__subId:xmlBlaster_192_168_1_4_3412-XPATH4'/>
<content/>
<multiSubscribe/>
<local/>
<initialUpdate/>
<updateOneway>false</updateOneway>
<notify/>
<persistent>false</persistent>
<isSubscribe/>
</qos>
</subscription>
<subscription id='__subId:xmlBlaster_192_168_1_4_3412-XPATH4' sessionName='/node/xmlBlaster_192_168_1_4_3412/client/joe/1' numChilds='3' creationTime='Oct 13, 2004 10:52:11 AM'>
<key queryType='XPATH'>
//key
</key>
<qos>
<subscribe id='__subId:xmlBlaster_192_168_1_4_3412-XPATH4'/>
<content/>
<multiSubscribe/>
<local/>
<initialUpdate/>
<updateOneway>false</updateOneway>
<notify/>
<persistent>false</persistent>
<isSubscribe/>
</qos>
<child>__subId:xmlBlaster_192_168_1_4_3412-XPATH4:5</child>
<child>__subId:xmlBlaster_192_168_1_4_3412-XPATH4:6</child>
<child>__subId:xmlBlaster_192_168_1_4_3412-XPATH4:7</child>
</subscription></SessionInfo>]]></content>
<qos>
<isGet/>
</qos>



If you use a perl/java ... client you send the admin command with a key oid = '__cmd:client/joe/1/?subscriptionDump', for example:

java javaclients.HelloWorldGet -oid '__cmd:client/joe/1/?subscriptionDump'


Please do a cvs update to have access to this dump,

regards

Marcel

--
http://www.xmlBlaster.org