IBM Support

Getting RC 2045 MQRC_OPTION_NOT_VALID_FOR_TYPE when trying to get/browse a message from a non-local queue

Question & Answer


Question

You put a message into a WebSphere MQ (WMQ) remote queue definition in local QMgr1 and the message is sent to an associated queue in remote QMgr2. However, you want to know if you can read a message from a remote queue definition? Similarly with clustered queues: you can put a message into a definition of a clustered queue which has no local storage in QMgr1 and it is sent to the corresponding local queue in QMgr2. You want to know if you can read a message from a definition of a clustered queue?

Answer

Regarding the MQ GET function, an application can ONLY get, browse or read messages from a local queue which resides inside a queue manager, such as QMgr1. It is NOT possible to get or browse messages when connected to QMgr1 from a remote queue which resides in another queue manager, such as QMgr2. This applies to remote queue definitions and to clustered queues, where the local queue is in a remote queue manager.

It is not possible to extrapolate the behavior from the PUT function to the GET function. The PUT function allows you to connect to QMgr1 and then put a message into a remote queue which resides in QMgr2, via a remote queue definition and a transmission queue, or via a clustered queue and associated MQ clustering framework.

Example:

1) Create a QREMOTE (remote queue definition)

C:\> runmqsc QM_ANGELILLO
define qremote(QR1)
1 : define qremote(QR1)
AMQ8006: WebSphere MQ queue created.


2) Use the MQ sample to get a message:

C:\> amqsget QR1 QM_ANGELILLO
Sample AMQSGET0 start
MQOPEN ended with reason code 2045
unable to open queue for input
Sample AMQSGET0 end


3) Find out the short description of the reason code 2045 by using the MQ mqrc utility:

C:\> mqrc 2045
2045 0x000007fd MQRC_OPTION_NOT_VALID_FOR_TYPE

[{"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Capability","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.0;7.5;7.1;7.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSYHRD","label":"IBM MQ"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Product Synonym

WebSphere MQ WMQ

Document Information

Modified date:
15 June 2018

UID

swg21650274