Running the amqsget and amqsgetc samples
- The name of the source queue (required)
- The name of the queue manager (optional)
If a queue manager is not specified, amqsget connects to the default queue manager and amqsgetc connects to the queue manager identified by an environment variable or the client channel definition file.
- The open options (optional)
If open options are not specified, the sample uses a value of 8193 which is the combination of these two options:
- MQOO_INPUT_AS_Q_DEF
- MQOO_FAIL_IF_QUIESCING
- The close options (optional)
If close options are not specified, the sample uses a value of 0 which is MQCO_NONE.
These programs also use an environment variable named MQSAMP_USER_ID which should be set to the user ID to be used for connection authentication. When this is set, the program will prompt for a password to accompany that user ID.
amqsget myqueue qmanagername
amqsgetc myqueue qmanagername
myqueue
is the name of the queue from which the program will get messages, and qmanagername
is the queue manager that owns myqueue
.
Using amqsget and amqsgetc
Note that amqsget performs a local connection to the queue manager, using shared memory to attach to the queue manager, and as such can only be run on the system the queue manager resides, whereas amqsgetc performs a client style connection (even if connecting to a queue manager on the same system).
When using amqsgetc you need to provide the application details of how to actually reach the queue manager, in terms of the queue manager host or IP address and queue manager listener port.
Normally this is done either using the MQSERVER environment variable or by defining connection details using a client channel definition table,which can also be provided to amqsgetc using environment variables.
export MQSERVER="SYSTEM.DEF.SVRCONN/TCP/ localhost(1414)"