Home

 

WebSphere MQ for HP-UX

 

Before you use an existing user exit for the first time on WebSphere MQ for HP-UX, recompile it to enable it to take advantage of thread-safe system calls. If your user exits use thread-unsafe system calls, you will need to modify them before using them on this platform.

The exit is a dynamically loaded object that must be written in C. To ensure that it can be loaded when required, put 32-bit exits in /var/mqm/exits and 64-bit exits in /var/mqm/exits64. These are the default paths for exits in the ExitPath stanza of the 'qm.ini' file or the ClientExitPath stanza of the 'mqs.ini' file and can be changed if required. Exits on the server use the 'qm.ini' file, those on the client use the 'mqs.ini' file. Alternatively we can specify the full path name in the MQCD if MQCONNX is used or in the DEFINE CHANNEL command.

Define a dummy MQStart() routine in the exit and specify MQStart as the entry point in the module. Figure 1 shows how to set up an entry to your program:

Figure 1. Sample source code for a channel exit on HP-UX
#include <cmqc.h>
#include <cmqxc.h>
 
void MQStart() {;} /* dummy entry point - for consistency only */
void MQENTRY ChannelExit ( PMQVOID pChannelExitParms,
                           PMQVOID pChannelDefinition,
                           PMQLONG pDataLength,
                           PMQLONG pAgentBufferLength,
                           PMQVOID pAgentBuffer,
                           PMQLONG pExitBufferLength,
                           PMQPTR  pExitBufferAddr)
{
… Insert code here
}

Figure 2 shows the compiler and linker commands for channel-exit programs on HP-UX.

Figure 2. Sample compiler and linker commands for channel exits on HP-UX
$ c89 +DD64 +z -c -D_HPUX_SOURCE -o exit.o exit.c -I/opt/mqm/inc
$ ld -b +noenvvar exit.o +ee MQStart +ee ChannelExit -o 
/var/mqm/exits64/exit -L/opt/mqm/lib64 -L/usr/lib/pa20_64 -lmqm_r -lpthread
$ rm exit.o
In this case exit is the library name and ChannelExit is the function name. These names are used by the channel definition to reference the exit program using the format described in Exit name fields. See also the MSGEXIT parameter of the Define Channel command in WebSphere MQ Script (MQSC) Command Reference

On the client, a 32-bit or 64-bit exit can be used. This must be linked to mqic_r.

 

Parent topic:

Writing and compiling channel-exit programs


ic17690_


 

Home