IBM Support

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

Technote (FAQ)


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?


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.


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

Cross reference information
Segment Product Component Platform Version Edition
Business Integration IBM MQ

Product Alias/Synonym

WebSphere MQ WMQ

Document information

More support for: WebSphere MQ

Software version: 7.0, 7.1, 7.5, 8.0, 9.0

Operating system(s): AIX, HP-UX, Linux, Solaris, Windows

Reference #: 1650274

Modified date: 14 October 2013

Translate this page: