Bootstrap FreeKB - IBM MQ - Resolve "AMQ8148E IBM MQ object in use" when attempting to delete a queue
IBM MQ - Resolve "AMQ8148E IBM MQ object in use" when attempting to delete a queue

Updated:   |  IBM MQ articles

Let's say you try to delete local queue named "queue001" using the delete qlocal command.

echo "delete qlocal (queue001)" | runmqsc MANAGER01

 

And the following is returned.

AMQ8148E IBM MQ object in use

 

The display qstatus command can be used to display the number of connections to the queue.

echo "display qstatus (queue001)" | runmqsc MANAGER01

 

Something like this should be returned. Notice that IPPROCS is 1, meaning there is 1 GET connection to the queue. OPPROCS is the PUT connections count.

AMQ8450I: Display queue status details.
   QUEUE(QUEUE001)                TYPE(QUEUE)
   CURDEPTH(0)                    IPPROCS(1)
   LGETDATE( )                    LGETTIME( )
   LPUTDATE( )                    LPUTTIME( )
   MEDIALOG(S0036640.LOG)         MONQ(OFF)
   MSGAGE( )                      OPPROCS(0)
   QTIME( , )                     UNCOM(NO)

 

The stop channel command can be used to stop the channel that is being used to prevent new connections from being made to the channel.

echo "stop channel (channel001)" | runmqsc MANAGER01

 

The following should be displayed.

AMQ8019I: Stop IBM MQ channel accepted.

 

After the channel has been stopped, the display chstatus command should have STOPPED.

AMQ8417: Display Channel Status details.
  CHANNEL(channel001)       CHLTYPE(SVRCONN)
  CONNAME(10.1.2.3)         CURRENT
  STATUS(STOPPED)           SUBSTATE( )

 

The display conn command can be used to display the connections to the channel being used by the queue. 

echo "display conn (*) where (CHANNEL eq CHANNEL001) all" | runmqsc MANAGER01

 

Something like this should be returned. Notice in this example that the connection ID is A542B3602EA19C22.

AMQ8276I: Display Connection details.
   CONN(A542B3602EA19C22)                
   EXTCONN(414D51434D5148554257413120202020)
   TYPE(CONN)                            
   PID(14902)                              TID(484286) 
   APPLDESC(IBM MQ Channel)             
   APPLTAG()
   APPLTYPE(USER)                          ASTATE(NONE)
   CHANNEL(CHANNEL001)                     CLIENTID( )
   CONNAME(10.14.123.60)                
   CONNOPTS(MQCNO_HANDLE_SHARE_BLOCK,MQCNO_SHARED_BINDING)
   USERID(john.doe)                        UOWLOG( )
   UOWSTDA( )                              UOWSTTI( )
   UOWLOGDA( )                             UOWLOGTI( )
   URTYPE(QMGR)                         
   EXTURID(XA_FORMATID[] XA_GTRID[] XA_BQUAL[])
   QMURID(0.0)                             UOWSTATE(NONE)

 

The stop conn command can be used to stop the connection.

echo "stop conn (A542B3602EA19C22)" | runmqsc MANAGER01

 

Something like this should be returned.

  18 : stop conn (3944303409348938434)
AMQ8457I: IBM MQ connection stopped.

 

Now if you resissue the display qstatus command . . .

echo "display qstatus (queue001)" | runmqsc MANAGER01

 

IPPROCS and OPPROCS should both be 0, meaning there are 0 connections to the queue.

AMQ8450I: Display queue status details.
   QUEUE(QUEUE001)                TYPE(QUEUE)
   CURDEPTH(0)                    IPPROCS(0)
   LGETDATE( )                    LGETTIME( )
   LPUTDATE( )                    LPUTTIME( )
   MEDIALOG(S0036640.LOG)         MONQ(OFF)
   MSGAGE( )                      OPPROCS(0)
   QTIME( , )                     UNCOM(NO)

 

And you should be able to delete the queue now.

echo "delete qlocal (queue001)" | runmqsc MANAGER01

 

Do not forget to either delete the channel (if it is no longer needed) using the delete channel command 

echo "delete channel (channel001)" | runmqsc MANAGER01

 

Or to start the channel (if it is still needed) using the start channel command.

echo "start channel (channel001)" | runmqsc MANAGER01

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


November 03 2023 by Nout
It would be useful to have a way to determine which channels are being used to access a particular queue.

March 25 2024 by Vijay P
Excellent way of work

Add a Comment


Please enter ab7eed in the box below so that we can be sure you are a human.