building messages, incorporating WebSphere MQ commands, messages, in request messages, commands" /> Sending commands to the command server

 

Sending commands to the command server

For each command, you build a message containing the command, then put it onto the system-command input queue.

 

Building a message that includes WebSphere MQ commands

We can incorporate WebSphere MQ commands in an application program by building request messages that include the required commands. For each such command you:

  1. Create a buffer containing a character string representing the command.

  2. Issue an MQPUT call specifying the buffer name in the buffer parameter of the call.

The simplest way to do this in C is to define a buffer using 'char'. For example:

 char message_buffer[ ] = "ALTER QLOCAL(SALES) PUT(ENABLED)";

When you build a command, use a null-terminated character string. Do not specify a command prefix string (CPF) at the start of a command defined in this way. This means that you do not have to alter your command scripts if you want to run them on another queue manager. However, take into account that a CPF is included in any response messages that are put onto the reply-to queue.

The command server folds all lowercase characters to uppercase unless they are inside single quotes.

Commands can be any length up to a maximum 32 762 characters.