Migrating WebSphere MQ brokers

Migrating WebSphere MQ brokers

When you plan the migration of one or more WebSphere MQ brokers, you must take account of the differences between WebSphere MQ Publish/Subscribe and WebSphere Event Broker. This might mean that you have to make some changes to your applications, your topics, or both, before you start migration.

The information here tells you the steps you must take to migrate a single broker. Migrating a WebSphere MQ broker network tells you how to migrate a WebSphere MQ broker network.

These steps result in the replacement of the WebSphere MQ brokers by WebSphere Event Broker brokers.

Each replacement WebSphere Event Broker broker must be created on the same queue manager as the WebSphere MQ broker that it replaces. Because the WebSphere MQ broker shares the same name as the queue manager that supports it, you must specify the WebSphere MQ broker name as the queue manager parameter on the mqsicreatebroker command (the -q flag).

Migration involves the transfer of the following state information from the WebSphere MQ broker to the WebSphere Event Broker broker:
  • Subscriptions.

    All client subscriptions are exported from all streams except SYSTEM.BROKER.ADMIN.STREAM.

  • Retained publications.

    All retained publications in MQRFH format are exported from all streams except SYSTEM.BROKER.ADMIN.STREAM.

  • Local publishers.

    Registrations for all publishers that are producing local publications are exported from all streams except SYSTEM.BROKER.ADMIN.STREAM.

  • Related brokers.

    If the broker is part of a multi-broker hierarchy, details of all its relations are exported. This includes the names of all streams that the broker to be migrated has in common with the relation.

  • Streams.

    On WebSphere MQ Publish/Subscribe, streams are the queues from which publications are read by a broker.

This information is exported as a series of messages that are sent from the WebSphere MQ broker to its replacement. When migration is complete, the WebSphere MQ broker is deleted automatically, and cannot be recreated.

The workbench and migration

If you are migrating a WebSphere MQ broker, you cannot fully deploy it in your WebSphere Event Broker broker domain until migration has completed successfully. You should not deploy additional execution groups or message flows until after you have successfully migrated the WebSphere MQ Publish/Subscribe broker.

Use the Broker Topology editor to define the WebSphere Event Broker broker, and deploy the topology. Create an empty .bar file and drag it onto the default execution group. You are now ready to start the migration.

If migration fails, and you want to revert to your WebSphere MQ broker, you must delete the WebSphere Event Broker. See Deleting a broker.

Migrating a single broker

When you migrate a WebSphere MQ broker that is not part of a network, you are replacing it in the network and assigning all the function that was previously supported by that broker to a WebSphere Event Broker broker.

You must shutdown the WebSphere MQ broker before you start migration, and ensure that all applications that use the broker are also quiesced.

Preparing for the migration

Before you can migrate a broker, you need to do some preparation.
  1. Identify the WebSphere MQ broker that you are going to migrate.

    The steps used here assume you have chosen the name WBRK_BROKER for your new WebSphere Event Broker broker, and that the WebSphere MQ broker you are migrating is currently hosted by the queue manager MQPS_BROKER1.

  2. Back up the queue manager hosting the WebSphere MQ broker.

    Ensure that this backup is complete backup before you start the migration process. This allows you to retrieve the old WebSphere MQ broker after successful migration, if you should need to do so for any reason. The WebSphere MQ System Administration book describes this backup process.

  3. Quiesce any applications that are registered with the broker.

    Any messages generated during the migration exercise are queued and could cause performance or capacity problems. Quiescing the applications as well as the broker ensures that publish/subscribe traffic is only generated when there is a broker ready to process it.

  4. End your WebSphere MQ broker operation:
    endmqbrk MQPS_BROKER1

Preparing the replacement broker

You are now ready to work with the new broker.
  1. Create a WebSphere Event Broker broker.
    You must create the new broker on the system on which the queue manager MQPS_BROKER1 is defined. You must select the migration option (flag -m) on the command.
    mqsicreatebroker WBRK_BROKER -q MQPS_BROKER1
    -i mqbroker -a sample -n WBRKBKDB -m
  2. Start the new WebSphere Event Broker broker:
    mqsistart WBRK_BROKER
  3. Configure the broker in the workbench.

    Create the new broker in the broker domain topology from the Topology view in the workbench. Save and deploy the topology. Create a default execution group and drag an empty .bar file onto the default execution group.

Migrating the WebSphere MQ broker

The new WebSphere Event Broker broker is ready to receive migration data for the WebSphere MQ broker that it replaces.
  1. Migrate the WebSphere MQ broker function to the replacement WebSphere Event Broker broker by issuing the following command:
    migmqbrk -m MQPS_BROKER1

    This command is supplied as part of the WebSphere MQ Publish/Subscribe package on the Web. You must ensure you have the latest level of this command, and the WebSphere MQ Publish/Subscribe User's Guide that describes its use.

    The command retrieves the persistent information (subscriptions and retained publications) from the WebSphere MQ broker, and sends it in specially constructed messages to the queue SYSTEM.BROKER.INTERBROKER.QUEUE on the new WebSphere Event Broker broker.

    The message flow that services this queue (deployed when you deployed the broker and its default execution group) receives these messages and records the information. When all the messages have been processed, the message flow is terminated and cannot be re-initialized.

    The migration command can only be re-invoked if the whole process of migration has not completed successfully. If any error occurs, for any reason, the WebSphere MQ broker is recoverable and can be restarted. You can then continue to use it. The WebSphere Event Broker broker also exists, but has not recorded any migration information. You can delete and create this broker to restart the migration process.

    If the whole process succeeds, the WebSphere MQ broker no longer exists and cannot be recovered.

    You receive the following message on successful completion of migration:
    WebSphere
    MQ broker has been successfully migrated

    When you have successfully migrated all the WebSphere MQ brokers that you plan to migrate, delete or rename the file strmqbrk.exe. This prevents any WebSphere MQ brokers from starting accidentally.

Deploying the stream queues

The new WebSphere Event Broker broker is now set up to take over from the WebSphere MQ broker. You must create and deploy the message flows that it needs to activate the streams; you do not need to define the stream queues, because these are already defined to the queue manager. The queue definitions are not deleted when the migration takes place, and the same queue manager is used by the WebSphere MQ broker and the WebSphere Event Broker broker that has replaced it.

You can create the message flows you need by following these steps:
  1. Start the workbench and select the message flow view.
  2. For each stream, including the default stream:
    1. Build a basic publish/subscribe message flow by copying and renaming the supplied publish/subscribe message flow.
    2. Check the properties of the nodes in each message flow that you create.

      You must set the input queue name (the stream queue) property in the input node. You must also set the implicitStreamNaming property for every non-default stream queue input node.

    3. Finally, assign the message flow to an execution group of the broker WBRK_BROKER, check in your changes, and deploy the broker.