Checking the results of deployment using the Configuration Manager Proxy API

If you are using a Configuration Manager Proxy application, you can find out the result of a publish/subscribe topology deployment operation, for example, by using code similar to this:
TopologyProxy t = cmp.getTopology();

boolean isDelta = true;
long timeToWaitMs = 10000;
DeployResult dr = topology.deploy(isDelta, timeToWaitMs);

System.out.println("Overall result = "+dr.getCompletionCode());

// Display overall log messages
Enumeration logEntries = dr.getLogEntries();
while (logEntries.hasMoreElements()) {
  LogEntry le = (LogEntry)logEntries.nextElement();
  System.out.println("General message: " + le.getDetail());
}

// Display broker specific information
Enumeration e = dr.getDeployedBrokers();
while (e.hasMoreElements()) {

  // Discover the broker
  BrokerProxy b = (BrokerProxy)e.nextElement();

  // Completion code for broker
  System.out.println("Result for broker "+b+" = " +
    dr.getCompletionCodeForBroker(b));

  // Log entries for broker
  Enumeration e2 = dr.getLotEntriesForBroker(b);
  while (e2.hasMoreElements()) {
    LogEntry le = (LogEntry)e2.nextElement();
    System.out.println("Log message for broker " + b +
      le.getDetail()));
  }
}
The deploy() method blocks until all affected brokers have responded to the deployment request.

When the method returns, the DeployResult represents the outcome of the deployment at the time when the method returned; the object is not updated by the Configuration Manager Proxy.

If the deployment message could not be sent to the Configuration Manager, a ConfigManagerProxyLoggedException is thrown at the time of deployment. If the Configuration Manager receives the deployment message, then log messages for the overall deployment are displayed, followed by completion codes specific to each broker affected by the deployment. The completion code is one of the following static instances from the com.ibm.broker.config.proxy.CompletionCodeType class:

Completion code Description
pending The deploy is held in a batch and will not be sent until you issue ConfigManagerProxy.sendUpdates().
submitted The deploy message was sent to the Configuration Manager but no response was received before the timeout occurred.
initiated The Configuration Manager replied stating that deployment has started, but no broker responses were received before the timeout occurred.
successSoFar The Configuration Manager issued the deployment request and some, but not all, brokers responded with a success message before the timeout period expired. No brokers responded negatively.
success The Configuration Manager issued the deployment request and all relevant brokers responded successfully before the timeout period expired.
failure The Configuration Manager issued the deployment request and at least one broker responded negatively. You can use getLogEntriesForBroker for more information on why the deployment failed.
notRequired A deployment request was submitted to the Configuration Manager involved with the supplied broker, but the request was not sent to the broker because its configuration is already up to date.
Related concepts
Deployment overview
Configuration Manager Proxy
Related tasks
Deploying
Viewing broker domain log information
Configuration Manager Proxy trace
Resolving problems when deploying message flows or message sets
Resolving problems when developing Configuration Manager Proxy applications