Broker 10.15 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Publishing and Delivering Events | Publishing Events | Publishing Multiple Events
 
Publishing Multiple Events
Your application can publish several events with one call to the BrokerClient.publish method that accepts an array of BrokerEvent objects. The following example contains an excerpt that shows the use of this method, which accepts a BrokerEvent array.
. . .
BrokerClient c;
BrokerEvent e[5];
. . .
/* Create and initialize the event array */
. . .
try {
c.publish(e);
} catch (BrokerException ex) {
System.out.println("Error on publish\n"+ex);
return;
}
. . .
The BrokerClient.publishWithAck method can be used by your Broker client to publish one or more events while, at the same time, acknowledging the receipt of one or more events. For more information on event acknowledgement, see Using Sequence Numbers.