16.2. Patching a Standalone Container

Abstract

You apply patches to a standalone container using the command console's patch shell. You can apply and roll back patches as needed.

Overview

Patching a standalone container directs the container to load the patch versions of artifacts instead of the non-patch versions. The patch shell provides commands to patch the container's environment, see which bundles are effected by applying the patch, apply the patch to the container, and back the patch out if needed (see chapter "Patch Console Commands" in "Console Reference").
To make sure that a patch can be rolled back Red Hat JBoss A-MQ applies the patch in a non-destructive manner. The patching process does not overwrite the artifacts included in the original installation. The patched artifacts are placed in the container's system folder. When the patch is applied, the container's configuration is changed so that it points to the patched artifacts instead of the artifacts from the original installation. This makes it easy for the system to be restored to its original state or to selectively back out patches.
Important
Patches do not persist across installations. If you delete and reinstall a JBoss A-MQ instance you will need to download the patches and reapply them.

Applying a patch

To apply a patch to a standalone container:
  1. Add the patch to the container's environment using the patch:add command.
    Example 16.1, “Adding a Patch to a Broker's Environment” shows the command for adding the patch contained in the patch file patch.zip from the local file system.

    Example 16.1. Adding a Patch to a Broker's Environment

    JBoss A-MQ> patch:add file://patch.zip
    This command copies the specified patch file to the container's system folder and unpacks it.
  2. Simulate installing the patch using the patch:simulate command.
    This will generate a log of the changes that will be made to the container when the patch is installed, but will not make any actual changes to the container.
    Note
    The patch:list command displays a list of all patches added to the container's system folder.
  3. Review the simulation log to understand the changes that will be made to the container.
  4. Apply the patch to the container using the patch:install command.
    Warning
    Running patch:install before the container is fully started and all of the bundles are active will cause the container to hang.
    Note
    The patch:list command displays a list of all patches added to the container's system folder.
  5. Shut down the container that you just applied the patch to.
  6. The extracted patch archive contains the manual_steps directory. Copy the content of the manual_steps/xyz directory to the appropriate directory (bin, etc, lib) in the JBoss A-MQ 6.1 installation directory. Copy the content in the manual_steps/fabric-system-updates/system directory to the system directory in the JBoss A-MQ installation directory. This is the system repository that contains some patched artifacts.
  7. Start the container. If you are using a remote console, you will lose the connection to the container. If you are using the container's local console, it will automatically reconnect when the container restarts.

Rolling back a patch

Occasionally a patch will not work or introduce new issues to a container. In these cases you can easily back the patch out of the system and restore it pre-patch behavior using the patch:rollback command. As shown in Example 16.2, “Rolling Back a Patch”, the command takes the name of patch to be backed out.

Example 16.2. Rolling Back a Patch

JBoss A-MQ> patch:rollback patch1
Note
The patch:list command displays a list of all patches added to the container's system folder.
The container will need to restart to roll back the patch. If you are using a remote console, you will lose the connection to the container. If you are using the container's local console, it will automatically reconnect when the container restarts.

Adding features to a patched container

Since JBoss A-MQ 6.1, it is possible to add Karaf features to an already patched standalone container without performing any special steps.