+

Search Tips | Advanced Search

Sample cluster workload exit

IBM MQ includes a sample cluster workload exit program. We can copy the sample and use it as a basis for the own programs.

    IBM MQ for z/OS
    The sample cluster workload exit program is supplied in Assembler and in C. The Assembler version is called CSQ4BAF1 and can be found in the library thlqual.SCSQASMS. The C version is called CSQ4BCF1 and can be found in the library thlqual.SCSQC37S. thlqual is the target library high-level qualifier for IBM MQ data sets in your installation.

    IBM MQ for Multiplatforms
    The sample cluster workload exit program is supplied in C and is called amqswlm0.c. It can be found in:

    Platform Filepath

    AIX

    MQ_INSTALLATION_PATH/samp

    Windows

    MQ_INSTALLATION_PATH \Tools\c\Samples

    IBM i

    The qmqm library

    MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

This sample exit routes all messages to a particular queue manager, unless that queue manager becomes unavailable. It reacts to the failure of the queue manager by routing messages to another queue manager.

Indicate which queue manager we want messages to be sent to. Supply the name of the cluster-receiver channel in the CLWLDATA attribute on the queue manager definition. For example:
ALTER QMGR CLWLDATA(' my-cluster-name. my-queue-manager ')

To enable the exit, supply its full path and name in the CLWLEXIT attribute:

On UNIX and Linux :
ALTER QMGR CLWLEXIT(' path /amqswlm(clwlFunction)')
On Windows:
ALTER QMGR CLWLEXIT(' path \amqswlm(clwlFunction)')
On z/OS:
ALTER QMGR CLWLEXIT(CSQ4BxF1)
where x is either 'A' or 'C', depending on the programming language of the version we are using. On IBM i, use either of the following commands:

  • Use the MQSC command:
    ALTER QMGR CLWLEXIT('AMQSWLM       library       ')
    
    Both the program name and the library name occupy 10 characters and are blank-padded to the right if necessary.
  • Use the CL command:
    CHGMQM MQMNAME( qmgrname ) CLWLEXIT(' library /AMQSWLM')
    

Now, instead of using the supplied workload management algorithm, IBM MQ calls this exit to route all messages to your chosen queue manager.

Parent topic: Writing and compiling cluster workload exits

Last updated: 2020-10-04