See information about the latest product version
Deploying a broker archive file
After you have created and populated a broker archive (BAR) file, deploy the file to an execution group on a broker, so that the file contents can be used in the broker.
This topic assumes that you have created a BAR file. For more information, see Creating a broker archive (BAR) file.
If you change a BAR file, and want to propagate those changes to one or more brokers, you can redeploy the updated BAR file by following the instructions in Redeploying a BAR file.
The mode in which your broker is working can affect the number of execution groups and message flows that you can deploy, and the types of node that you can use. See Restrictions that apply in each operation mode.
When you deploy a message flow that contains a subflow that is defined in .subflow file you must deploy the subflow to the same execution group. You cannot deploy the message flow before the subflow, but you can deploy the subflow first, or both resources together. If you redeploy a subflow that is defined in a .subflow file to an execution group, any message flows that use the subflow in that execution group are stopped and restarted. When the message flows restart, they use the updated subflow.
Using the WebSphere Message Broker Toolkit
To deploy a BAR file by using the WebSphere® Message Broker Toolkit, complete the following steps. You can deploy to only one execution group at a time.
Using the WebSphere Message Broker Explorer
Import a BAR file into the WebSphere Message Broker Explorer by following the instructions in Importing a broker archive file to the WebSphere Message Broker Explorer.
To deploy a BAR file by using the WebSphere Message Broker Explorer, complete the following steps.
Using the mqsideploy command
To deploy a BAR file by using the mqsideploy command, complete the following steps.
The command reports when responses are received from the broker. If the command completes successfully, it returns 0 (zero).
Using the CMP API
To deploy by using the CMP API, use the deploy method of the ExecutionGroupProxy class.
import com.ibm.broker.config.proxy.*;
public class DeployBAR {
public static void main(String[] args) {
BrokerConnectionParameters bcp =
new MQBrokerConnectionParameters("localhost", 2414, "MB8QMGR");
try {
BrokerProxy b = BrokerProxy.getInstance(bcp);
ExecutionGroupProxy eg = b.getExecutionGroupByName("default");
DeployResult dr = eg.deploy("MyBAR.bar", true, 30000);
System.out.println("Result = "+dr.getCompletionCode());
} catch (Exception e) {
e.printStackTrace();
}
}
}
By default, the deploy method performs
an incremental deployment. To perform a complete deployment, use a
variant of the method that includes a false value
for the Boolean isIncremental parameter. For example, e.deploy("deploy.bar",false,0).
Set this parameter to true to request an incremental
deployment.Redeploying a BAR file
You might change a BAR file and want to propagate those changes to one or more brokers. If so, you can redeploy the updated BAR file to one or more execution groups by using one of the deployment methods described previously. You do not have to stop the message flows that you deployed previously; all resources in the execution group or groups that are in the redeployed BAR file are replaced and new resources are applied.
If your updates to the BAR file include the deletion of resources, a redeployment does not result in their deletion from the broker. For example, assume that your BAR file contains applications A1, A2, and A3. Update the file by removing A2 and adding application A4. If you redeploy the BAR file, all four applications are available in the execution group when the redeployment has completed. A1 and A3 are replaced by the contents of the redeployed BAR file.
- To use the WebSphere Message Broker Toolkit, follow the instructions for a complete deployment, making sure that you select before deploying.
- To use the WebSphere Message Broker Explorer, follow the instructions for a complete deployment, making sure that you select Delete All Flows and Resources before deploying.
- To use the mqsideploy command, follow the instructions, making sure that you add the –m parameter to perform a complete BAR file deployment.
- To use the CMP API, follow the instructions for a complete deployment.
If your message flows are not transactional, stop the message flows before you redeploy to be sure that all the applications complete cleanly and are in a known and consistent state. You can stop individual message flows, execution groups, or brokers.
If your message flows are transactional, the processing logic that handles commitment or rollback ensures that resource integrity and consistency are maintained.
Check the results of the redeployment by following the instructions in Checking the results of deployment.