You can use the Configuration Manager Proxy (CMP) for deployment when developing your applications. The following code is an example of the code that you can use in your own applications. It adds a broker called ‘B2’ that is running on queue manager ‘QMB2’ to the domain and associates with it an execution group called ‘default’. This configuration is then deployed to the broker.
For this example to work successfully, the broker ‘B2’ has been created on the machine running queue manager ‘QMB2’, and it has not already been deployed to by another Configuration Manager.
import com.ibm.broker.config.proxy.*; public class AddBroker { public static void main(String[] args) { ConfigManagerProxy cmp = null; try { ConfigManagerConnectionParameters cmcp = new MQConfigManagerConnectionParameters( "localhost", 1414, ""); cmp = ConfigManagerProxy.getInstance(cmcp); } catch (ConfigManagerProxyException cmpex) { System.out.println("Error connecting: "+cmpex); } if (cmp !=null) { System.out.println("Connected to Config Manager!"); addBroker(cmp, "B2", "QMB2", "default"); cmp.disconnect(); } } private static void addBroker(ConfigManagerProxy cmp, String bName, String bQMgr, String egName) { TopologyProxy topology = null; try { topology = cmp.getTopology(); } catch(ConfigManagerProxyPropertyNotInitializedException ex) { System.err.println("Comms problem! "+ex); } if (topology != null) { try { BrokerProxy b2 = topology.createBroker(bName, bQMgr); ExecutionGroupProxy e = b2.createExecutionGroup(egName); b2.deploy(); } catch (ConfigManagerProxyException ex) { System.err.println("Could not perform an action: "+ex); } } } }
Deployment type | Description |
---|---|
TopologyProxy.deploy() | Deploys the publish/subscribe topology configuration to all affected brokers. |
BrokerProxy.deploy() | Deploys the broker configuration. |
ExecutionGroupProxy.deploy() | Deploys a BAR file to an execution group. |
TopicRootProxy.deploy() | Deploys the topic hierarchy to all brokers. |
ConfigManagerProxy.cancelDeployment() | Cancels all outstanding deploys in the domain. |
BrokerProxy.cancelDeployment() | Cancels any outstanding deploy to a specific broker. |
Most deployment methods return an object of type DeployResult, which reveals further information on the deployment. See Checking the results of deployment for more information.
Notices |
Trademarks |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
af20125_ |