Delivering Multiple Events
The following example shows the use of the BrokerClusterPublisher.deliver method to deliver a single event. This method accepts these parameters:
A string containing the destination identifier (client identifier of the recipient).
An array of BrokerEvents to be delivered.
The following example illustrates how to deliver multiple events:
. . .
BrokerClusterPublisher bcp;
BrokerEvent e, event;
String dest_id = "DestClient";
. . .
/* create a BrokerClusterPublisher */
. . .
/* create an array of events to be sent and set the event fields */
. . .
/* Deliver events to the recipient */
try {
bcp.deliver( dest_id, e);
} catch (BrokerException ex) {
System.out.println("Error on delivering events\n"+ex);
return;
}
. . .