Broker 10.15 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Publishing and Delivering Events | Delivering Events | Delivering an Event
 
Delivering an Event
The following example shows the use of the BrokerClient.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.
Note:
Delivering an event to a Broker client that no longer exists will not return an error.
. . .
BrokerClient c;
BrokerEvent e, event;
String dest_id;
. . .
/* create a client */
. . .
/* open any subscriptions */
. . .
/* receive an event */
. . .
/* create the event to be sent and set the event fields */
. . .
/* obtain the client id of the recipient from the received event */
try {
dest_id = event.getStringField("_env.pubId");
} catch (BrokerException ex) {
System.out.println("Error on getting destination ID\n"+ex);
return;
}
/* Deliver the event to the recipient */
try {
c.deliver( dest_id, e);
} catch (BrokerException ex) {
System.out.println("Error on delivering event\n"+ex);
return;
}
. . .