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 the MQSERVER 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.
- MQSAMP_USER_ID
- Set to the user ID to be used for connection authentication, if you want use a user ID and a password to authenticate with the queue manager. The program prompts for the password to accompany the user ID.
![[AIX]](ngaix.gif)
![[MQ 9.3.4 Oct 2023]](ng934.gif)
MQSAMP_TOKEN- Set to a non-blank value if you want to supply an authentication token to authenticate with the queue manager. The program prompts for the authentication token. Authentication tokens can be used only by the amqsgetc sample that uses client bindings.
amqsget myqueue qmanagernameamqsgetc myqueue qmanagername
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; for example, see MQCCDTURL.
export MQSERVER="SYSTEM.DEF.SVRCONN/TCP/ localhost(1414)"