IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Submitting batch requests from a CMP application

Use the CMP to group multiple requests that are destined for the same broker, and submit them as a single unit of work.

To start a batch, your application must call the beginUpdates() method on the BrokerProxy handle. The CMP delays submitting any state-changing requests to the broker until it is told a batch of requests is ready to be sent.

The sendUpdates() method tells the CMP to submit as a batch all requests received since the last beginUpdates() call. The clearUpdates() method can be used to discard a batch without submitting it to the broker. The application can check if a batch is currently in progress by using the isBatching() method. Only one batch for an CMP handle can be in progress at any one time.

One advantage of using a batch method is that it provides an assurance that no other applications can have messages processed by the broker during the batch. When a broker receives a batch of requests, it processes each request in the batch in the order it was added to the batch (FIFO), and requests from no other CMP application are processed until the entire batch is completed.

Consider the following sequence of commands:
ExecutionGroupProxy e = b.createExecutionGroup("EG2");
e.deploy("mybar.bar");

Without using a batch method, the application cannot guarantee the success of these actions. For example, even if each command would otherwise succeed, a second (possibly remote) application might delete the integration server EG2 after it has been created by the first application, but before the other command is processed.

If the sequence is extended to use a batch method, the broker is now guaranteed to process all the commands together, therefore no other application can disrupt the logic intended by the application.
b.startUpdates();
ExecutionGroupProxy e = b.createExecutionGroup("EG2");
e.deploy("mybar.bar");
b.sendUpdates();

Another advantage of using a batch method is performance. The CMP typically sends one WebSphere® MQ message to the broker for each request.

In a situation that requires lots of requests to be sent in quick succession, the use of a batch has a significant effect on performance, reducing both time taken to process the requests, and the memory used. For example, your application might create a number of integration servers on a single broker. Each batch of requests is sent in a single WebSphere MQ message, therefore reducing the processing that is required for each method.

Batch mode does not provide transactional (commit and backout) capability; some requests in a batch might succeed and others fail. If the broker processes a request in a batch that fails, it continues to process the next request in the batch until it has attempted all requests in the batch.


ae33130_.htm | Last updated Friday, 21 July 2017