xmlBlaster 2.2.0 API

javaclients
Class HelloWorldPublish

java.lang.Object
  extended by javaclients.HelloWorldPublish

public class HelloWorldPublish
extends java.lang.Object

This client connects to xmlBlaster and publishes a configurable amount of 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.HelloWorldSubscribe' in another window to subscribe to our messages. Further you can type 'd' in the window running xmlBlaster to get a server dump.

Invoke (after starting the xmlBlaster server):
Publish manually 10 messages:
 java javaclients.HelloWorldPublish -interactive true -numPublish 10 -oid Hello -persistent true -erase true

Publish automatically 10 messages and sleep 1 sec in between:
 java javaclients.HelloWorldPublish -interactive false -sleep 1000 -numPublish 10 -oid Hello -persistent true -erase true

Publish automatically 10 different topics with different DOM entries:
 java javaclients.HelloWorldPublish -interactive false -numPublish 10 -oid Hello-${counter} -clientTags ""

Login as joe/5 and send one persistent message:
 java javaclients.HelloWorldPublish -session.name joe/5 -passwd secret -persistent true -dump[HelloWorldPublish] true

Send a PtP message:
 java javaclients.HelloWorldPublish -destination jack/17 -forceQueuing true -persistent true -subscribable true

Add some client properties which will be send in the qos to the receivers:
 java javaclients.HelloWorldPublish -clientProperty[transactionId] 0x23345 -clientProperty[myName] jack
creates a publish Qos containing:
   <clientProperty name='transactionId'>0x23345</clientProperty>
   <clientProperty name='myName'>jack</clientProperty>
 

If interactive is false, the sleep gives the number of millis to sleep before publishing the next message.

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

You can add '${counter}' or '${timestamp}' to the clientTags or the content string, each occurrence will be replaced by the current message number and current UTC timestamp.

See Also:
HelloWorldSubscribe, xmlBlaster interface

Field Summary
private  Global glob
           
private static java.util.logging.Logger log
           
private  boolean replacePlaceHolders
           
 
Constructor Summary
HelloWorldPublish(Global glob)
           
 
Method Summary
static void main(java.lang.String[] args)
          Try
 java.lang.String replacePlaceHolders(java.lang.String value, java.lang.String currCounter, java.lang.String timestamp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

glob

private final Global glob

log

private static java.util.logging.Logger log

replacePlaceHolders

private boolean replacePlaceHolders
Constructor Detail

HelloWorldPublish

public HelloWorldPublish(Global glob)
Method Detail

replacePlaceHolders

public java.lang.String replacePlaceHolders(java.lang.String value,
                                            java.lang.String currCounter,
                                            java.lang.String timestamp)

main

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


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.