Use the mqsiapplybaroverride command to replace configurable values in the broker archive (BAR) deployment descriptor with new values that you specify in a properties file.
Use the mqsireadbar command to see which properties you can configure by using the mqsiapplybaroverride command.
Write scripts to create BAR files and apply different override values in the broker deployment descriptor archive file by using the mqsiapplybaroverride command, together with the mqsicreatebar command. For a list of message flow node properties and the corresponding properties of the mqsiapplybaroverride command, see Configurable properties. The mqsiapplybaroverride command properties are also listed in the tables of properties in the reference topic for each affected node.
>>-mqsiapplybaroverride-- -b --BarFile--------------------------> >--+-----------------------+--+-----------------------+---------> '- -k --applicationName-' '- -m --manualOverrides-' >--+------------------+--+---------------------+--+------+------> '- -o --outputFile-' '- -p --overridesFile-' '- -r -' >--+---------------------+--+-------------------+-------------->< '- -v --traceFileName-' '- -y --libraryName-'
You can use this parameter with the –p (overrides file) and –m (manual overrides) parameters to target overrides at a specific application in the BAR file. If the overrides file specified by the –p parameter is a BAR file, and you set the –k parameter, the .appzip file of the application is located in the source and target BAR files. If the .appzip file is found in both locations, the deployment descriptor for the application is updated from the source BAR file. Similarly, if the overrides file specified by the –p parameter is a deployment descriptor, and you set the –k parameter, the deployment descriptor for the application is updated. If you set the –m and –k parameters, the manual overrides apply to the named application.
To apply overrides to a specific library in an application, you can use the –k parameter with the –y (library name) parameter.
To apply overrides to the deployment descriptors for an application and all libraries nested in that application, use the –k parameter with the –r parameter.
<?xml version="1.0" encoding="UTF-8"?>
to<?xml version="1.0"?>
You can set the starting point for the -r parameter to the BAR file or an application. If you set the -r and -k (application name) parameters, deployment descriptors are updated for that application and all libraries nested in that application. If you set the -r and -y (library name) parameters, the -r parameter has no effect because a library does not have nested applications or libraries. Therefore, the deployment descriptor is updated for that library only. If you do not set the -k or -y parameters, the -r parameter specifies that deployment descriptors in all applications and libraries in the BAR file are updated.
You can use this parameter with the –p (overrides file) and –m (manual overrides) parameters to target overrides at a specific library in the BAR file. If the overrides file specified by the –p parameter is a BAR file, and you set the –y parameter, the .libzip file of the library is located in the source and target BAR files. If the .libzip file is found in both locations, the deployment descriptor for the library is updated from the source BAR file. Similarly, if the overrides file that is specified by the –p parameter is a deployment descriptor, and you set the –y parameter, the deployment descriptor for the library is updated. If you set the –m and –y parameters, the manual overrides apply to the named library.
To apply overrides to a specific library in an application, you can use the –y parameter with the –k (application name) parameter.
In all cases, any existing deployment descriptor in the BAR file is renamed to META-INF\broker.xml.old, replacing any existing file of that name.
Variables and comments are not allowed in property files.
BIP1138I: Overriding BAR File using runtime mqsiapplybaroverride
If you do not run the command from a privileged environment, you are asked to confirm that you want to continue. When you click OK, a new privileged command console is created and the command completed, but all responses are written to the privileged environment and are lost when that console closes when the command completes.
On all operating systems, the user ID used to invoke this command must have write authority to the BAR file on the local system.
...
CALL mqsiapplybaroverride
...
For those examples that do not specify -k, -y or -r parameters, the configurable property updates are made only to the deployment descriptor for resources that are not applications or libraries. In such cases, no updates are made to resources contained in applications or libraries.
mqsiapplybaroverride -b myflow.bar -p mychanges.properties
mqsiapplybaroverride -b myflow.bar -p myOriginalBarFile.bar
mqsiapplybaroverride -b myflow.bar -k application1 -p myOriginalBarFile.bar -r
mqsiapplybaroverride -b myflow.bar -k application1 -y library1 -p myOtherBroker.xml
mqsiapplybaroverride -b myApp.bar -k application1 -m startMode=automatic -o myAppManual.bar
mqsiapplybaroverride -b c:\test.bar -p c:\my.properties
mqsiapplybaroverride –b c:\test.bar –p c:\previous.bar
mqsiapplybaroverride –b c:\test.bar –p c:\broker.xml
mqsiapplybaroverride –b c:\test.bar –m OLDA=NEWA,OLDB=NEWB
mqsiapplybaroverride –b c:\test.bar –m sampleFlow#MQInput.queueName=NEWC
mqsiapplybaroverride –b c:\test.bar -m sampleFlow#maximumRateMsgsPerSec=100
mqsiapplybaroverride –b c:\test.bar -m sampleFlow#notificationMsgsPerSec=150
mqsiapplybaroverride –b c:\test.bar –p c:\mynew.properties
where
file mynew.properties contains the following
lines:sampleFlow#MQInput.queueName=NEWC
OLDA=NEWA
OLDB=NEWB
mqsiapplybaroverride –b c:\test.bar –p c:\override.properties
where
file override.properties contains the following
lines:sampleFlow#MQ Input.queueName=NEW_INPUT_QUEUE
sampleFlow#sampleSubflow1.queueName
sampleSubflow1#queueName
SUBOUT=NEW_SUBOUT
For examples of the details that are contained in a properties file, see Editing configurable properties.