IBM WebSphere MQ 2042 error

我们两清 提交于 2019-12-24 01:36:11

问题


I have the following code:

int openOptions = MQC.MQOO_INQUIRE 
    + MQC.MQOO_FAIL_IF_QUIESCING
    + MQC.MQOO_INPUT_SHARED;

Which when executed, I am getting an error:

com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2042 MQJE001: Completion Code 2, Reason 2042

This happens while connecting my Java program with WebSphere MQ. Please note that the queue property is set as input shared. All help appreciated.


回答1:


Although the queue may be set to DEFSOPT(SHARED), this is only a default. It does not prevent a program from opening it with exclusive use. In particular, transmission queues for non-cluster channels, the command queue and other queues used by MQ system components are opened with exclusive use, regardless of the queue's default setting. Similarly, monitoring programs often open the event queues for exclusive use to ensure that other programs do not compete for messages and result in missed critical events.

Is it one of the event or XMit queues? If so, you may not be able to remove the error without stopping the channel or monitoring agent. If it is a user-defined queue, use the DISPLAY QSTATUS command to see which process has it open for exclusive input, then disconnect that process.

Here is an example:

C:\Users\T.Rob>runmqsc QM75
5724-H72 (C) Copyright IBM Corp. 1994, 2011.  ALL RIGHTS RESERVED.
Starting MQSC for queue manager QM75.


dis qs(system.admin.command.queue) all
     1 : dis qs(system.admin.command.queue) type(handle) all
AMQ8450: Display queue status details.
   QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE)       TYPE(HANDLE)
   APPLDESC(WebSphere MQ Command Server)
   APPLTAG(here MQ 7.5\bin\amqpcsea.exe)
   APPLTYPE(SYSTEM)                        BROWSE(NO)
   CHANNEL( )                              CONNAME( )
   ASTATE(NONE)                            HSTATE(ACTIVE)
   INPUT(EXCL)                             INQUIRE(YES)
   OUTPUT(NO)                              PID(5220)
   QMURID(0.0)                             SET(NO)
   TID(1)
   URID(XA_FORMATID[] XA_GTRID[] XA_BQUAL[])
   URTYPE(QMGR)

The output of the command will repeat for each process attached to the queue. It shows the executable name (in this case amqpcsea which is the command server), the type of open, the process ID and the thread ID. Note that here it shows INPUT(EXCL) indicating that nothing else can open the command queue for browsing or getting of messages.



来源:https://stackoverflow.com/questions/13965468/ibm-websphere-mq-2042-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!