Back to Notification Service Examples Page
The Benchmark Example provides a simple, basic demonstration of how to transmit events through the Notification Service. The example is a good starting-point for learning how to use the service since the more complex features, such as filtering, have been left out.
The Benchmark Example consists of supplier and consumer clients which
send and receive structured events, either singly or in
sequences (batches), using the push model. The clients are run
from the command-line (using the run
command described
below). Either of the supplier clients will send events to the either
of the consumer clients.
In addition to demonstrating how to use the basic features of the Notification Service, these clients can be used to test the Notification Service's general performance characterictics, such as the event transmission rate. Please note that the structured supplier (which sends events singly) can be used with the sequenced consumer and visa versa.
The client source files for the Benchmark example clients are:
BenchmarkStructuredSupplier.java - sends single structured events to the event channel.
BenchmarkStructuredConsumer.java - receives single structured events from the event channel.
BenchmarkSequenceSupplier.java - sends sequences (batches) of structured events to the event channel.
BenchmarkSequenceConsumer.java - receives sequences (batches) of structured events from the event channel.
From the command line use:
server -start NotificationService
Using the Administration Manager:
Start the Administration Manager, right click on the NotificationService node and select Start from the pop-up menu.
run
utility:
run com.prismt.cos.CosNotification.examples.Benchmark.BenchmarkStructuredSupplier [parameters]
and/or
run com.prismt.cos.CosNotification.examples.Benchmark.BenchmarkSequenceSupplier [parameters]
where [parameters]
is an optional list of one or more
parameters described in the Control Parameters for the Benchmark
Clients table below.
run
utility:
run com.prismt.cos.CosNotification.examples.Benchmark.BenchmarkStructuredConsumer [parameters]
and/or
run com.prismt.cos.CosNotification.examples.Benchmark.BenchmarkSequenceConsumer [parameters]
where [parameters]
is an optional list of one or more
parameters described in the Control Parameters for the Benchmark
Clients table below.
run com.prismt.cos.CosNotification.examples.Benchmark.BenchmarkStructuredConsumer -rt 100
Ctrl-C
in its
respective window or shell. Consumer clients can also be stopped
by typing entering the Return
key.
Each client can be started using one or more of the parameters described in the Control Parameters table shown below. These paramaters control the clients' behaviour and how events are transmitted through the Notification Service. The parameters should be separated by spaces when more than one parameter is used.
?
, -?
,
help
or -help
as the first
command line parameter will display a list of all paramaters and
their default values
< >
) are
are required; items separated by a vertical bar ( | ) are
optionsName | Description |
Structured Supplier |
Structured Consumer |
Sequence Supplier |
Sequence Consumer |
---|---|---|---|---|---|
-r <name>
|
The resolve name for the notification service. The default is "NotificationService". |
X | X | X | X |
-cid <number>
|
Attach the supplier or consumer to the channel with the specified identifier. The default is 0. The supplier or consumer will try to obtain the default admin from the channel, and will create a new admin if the default cannot be found. | X | X | X | X |
-dt <number>
|
The delay threshold; the supplier or consumer will pause after this number of events. The duration of the delay is specified by the -dl parameter. If the supplier or consumer is set up to report event rates, the event rates will include these delays in the calculations. The default value is 0, which means no delays occur. |
X | X | X | X |
-dl <number>
|
The duration of the delay pause in milliseconds. The default is 0, which means no delays occur. For delays to occur, both -dt and -dl must be specified and both must have non-zero values. | X | X | X | X |
-rt <number>
|
The report threshold; the supplier or consumer will report the current event rate after this number of events. The event rate reported is an average from the start (either from the first event sent or the first event received), and the time calculations include any time spent in a deliberate pause (see the -dt and -dl parameters). The default is 0, which disables event rate reporting. | X | X | X | X |
-rf <file>
|
Specifies the filename to which event rate reports will be sent. There is no default: if this parameter is omitted, event rate reports will simply be sent to the console. This parameter will have no effect unless reporting is enabled (see the -rt parameter above). |
X | X | X | X |
-p <true|false>
|
Allows the If this parameter is specified, the event's property setting will override the channel's property setting. For example, this can be used to enable transient events to be sent over a persistent channel. |
X | X | ||
-c <number>
|
The number of events to send. A value of 0 means an unlimited number of events will be sent. The default is 10000. For a sequence supplier, the actual number of events sent can exceed the value if, for example, the value specified is not a multiple of the sequence supplier's batch size. |
X | X | ||
-co <true|false>
|
Checks whether event IDs are received in first-in-first-out (FIFIO) order. When the supplier sends events, a numeric identifier is put into the event's remainder-of-body component. If this parameter is given a value of true, the consumer will check that each event received has an ID of 1 more than the previous ID received. The default is false. |
X | |||
-bs <number>
|
The batch size for structured event sequences. The batch size defines how many events in each sequence a supplier or consumer sends to or receives from the event channel, respectively. The example's default batch size is 10. Note that the batch size for sequences that a consumer receives
is set using the |
X | X | ||
-pi <number> |
The value for the sequence consumer's proxy supplier's
PacingInterval QoS property. The default is 0; the
units are 100 nanoseconds, and the minimum non-zero value is
10000. A non-zero value is useful for when the supplier's batch
size is not a multiple of the consumer's batch size; the pacing
interval will then cause the remaining events to be received.
For example, consider a supplier sending a total of 33 events in batches of 11, and a consumer set to receive batches of 10 events. Without a non-zero pacing interval, the consumer will never receive the final three events from its sequence proxy supplier. |
X |