xmlBlaster 1.6.2 client API

javaclients
Class HelloWorldSubscribe

java.lang.Object
  extended byjavaclients.HelloWorldSubscribe
All Implemented Interfaces:
I_Callback

public class HelloWorldSubscribe
extends java.lang.Object
implements I_Callback

This client connects to xmlBlaster and subscribes to messages.

This is a nice client to experiment and play with xmlBlaster as there are many command line options to specify the type and amount of messages published.

Try using 'java javaclients.HelloWorldPublish' in another window to publish some messages. Further you can type 'd' in the window running xmlBlaster to get a server dump.

Invoke (after starting the xmlBlaster server):
 java javaclients.HelloWorldSubscribe -xpath //key -initialUpdate true -unSubscribe true

 java javaclients.HelloWorldSubscribe -interactive false -oid Hello -initialUpdate true -unSubscribe true

 java javaclients.HelloWorldSubscribe -session.name joeSubscriber/5 -passwd secret -initialUpdate true -dump[HelloWorldSubscribe] true

 java javaclients.HelloWorldSubscribe -xpath //key -filter.type GnuRegexFilter -filter.query "^__sys__jdbc.*"

 java javaclients.HelloWorldSubscribe -xpath //key -filter.type XPathFilter -filter.query "//tomato"

 java javaclients.HelloWorldSubscribe -xpath //key -filter.type ContentLenFilter -filter.query "10"
 

If unSubscribe=false the message is not unsubscribed at the end, if disconnect=false we don't logout at the end.

See Also:
javaclients.HelloWorldPublish, javaclients.HelloWorldGet, xmlBlaster interface

Constructor Summary
HelloWorldSubscribe(Global glob_)
           
 
Method Summary
static void main(java.lang.String[] args)
          Try
 java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
          Here the messages from xmlBlaster arrive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelloWorldSubscribe

public HelloWorldSubscribe(Global glob_)
Method Detail

update

public java.lang.String update(java.lang.String cbSessionId,
                               UpdateKey updateKey,
                               byte[] content,
                               UpdateQos updateQos)
                        throws XmlBlasterException
Here the messages from xmlBlaster arrive.

Specified by:
update in interface I_Callback
Parameters:
cbSessionId - The session ID specified by the client which registered the callback. You can specify a cbSessionId during connection (with ConnectQos) and this is bounced back here so you can authenticate the message.
updateKey - The arrived key containing the topic name
content - The arrived message content. This is your payload.
Throws:
XmlBlasterException
See Also:
I_XmlBlasterAccess

main

public static void main(java.lang.String[] args)
Try
   java javaclients.HelloWorldSubscribe -help
 
for usage help


xmlBlaster 1.6.2 client API

Copyright © 1999-2007 The xmlBlaster.org contributers.