1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
To run the demo:
Start the IceStorm service:
$ icebox --Ice.Config=config.icebox
This configuration assumes there is a subdirectory named db in the
current working directory.
In a separate window:
$ java Subscriber
In another window:
$ java Publisher
While the publisher continues to run, "tick" messages should be
displayed in the subscriber window.
Both the subscriber and publisher take an optional topic name as a
final argument. The default value for this topic is "time".
Through the use of command-line options both the subscriber and
publisher can use different QoS for sending and receiving messages.
For the subscriber:
java Subscriber --oneway
The subscriber receives events as oneway messages. This is the
default.
java Subscriber --datagram
The subscriber receives events as datagrams.
java Subscriber --twoway
The subscriber receives events as twoway messages.
java Subscriber --ordered
The subscriber receives events as twoway messages with guaranteed
ordering.
java Subscriber --batch
This is an additional flag that forwards datagram and oneway events
to the subscriber in batches.
java Subscriber --id <id>
This option specifies a unique identity for this subscriber. When
you use this option, you should also run the subscriber on a fixed
port by setting the Clock.Subscriber.Endpoints property. For
example:
$ subscriber --Clock.Subscriber.Endpoints="tcp -p <port> -h <host>"
Replace "tcp" with "udp" when using the --datagram option.
java Subscriber --retryCount <count>
This option sets the retry count for a subscriber. This option
should be used in conjunction with the --id option. Setting
retryCount changes the default subscriber QoS to twoway.
For the publisher:
java Publisher --oneway
The publisher sends events as oneway messages. This is the default.
java Publisher --datagram
The publisher sends events as datagrams.
java Publisher --twoway
The publisher sends events as twoway messages.
|