After you have created and populated a broker archive (BAR) file, deploy the file to an integration server 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 integration servers 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 integration server. 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 integration server, any message flows that use the subflow in that integration server are stopped and restarted. When the message flows restart, they use the updated subflow.
To deploy a BAR file by using the IBM® Integration Toolkit, complete the following steps. You can deploy to only one integration server at a time.
Import a BAR file into the IBM Integration Explorer by following the instructions in Importing a broker archive file to the IBM Integration Explorer.
To deploy a BAR file by using the IBM Integration Explorer, complete the following steps.
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).
To deploy by using the CMP, 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, "IB9QMGR");
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.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 integration servers 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 integration server 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 integration server when the redeployment has completed. A1 and A3 are replaced by the contents of the redeployed BAR file.
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, integration servers, 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.