Delivering an Event
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).
The BrokerEvent to be delivered.
The following example illustrates how to deliver a single event:
. . .
BrokerClusterPublisher bcp;
BrokerEvent e, event;
String dest_id = "DestClient";
. . .
/* create a BrokerClusterPublisher */
. . .
/* create the event to be sent and set the event fields */
. . .
/* Deliver the event to the recipient */
try {
bcp.deliver( dest_id, e);
} catch (BrokerException ex) {
System.out.println("Error on delivering event\n"+ex);
return;
}
. . .