|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQAX.QMgr.ConnectionHandle not the same as MQCONN.HConn |
« View previous topic :: View next topic » |
Author |
Message
|
HrothgarV |
Posted: Tue Jul 29, 2003 8:07 am Post subject: MQAX.QMgr.ConnectionHandle not the same as MQCONN.HConn |
|
|
Novice
Joined: 07 Apr 2003 Posts: 17
|
Hi,
I am developing an app that would monitor the queues and channels of mqseries. I am using both the MQAX and MQAI components of mqseries. I initially setup my session and connected to the queue manager using the MQAX component (mqsession.accessqueuemanager). This works fine and I am able to retrieve the needed queue information (current depth, limits, etc). The qmgr object has a ConnectionHandle property, that I assumed would be same as the HConn handle when I issue the MQCONN api command. To monitor the channels, I have to use the MQAI components. I have successfully created and populated the MQAI bags. When I issued the mqExecute(hConn,parm,parm,,,) command using the ConnectionHandle of the MQAX QMgr object, MQseries rejected this and returned an error (2018). To debug, I issued a MQCONN and then used the HConn handle in the mqExecute call and this worked fine. I also compared the MQAX qmgr.ConnectionHandle vs the MQCONN.Hconn AND They are VERY MUCH different.
Any help would be appreciated...
thanks, |
|
Back to top |
|
 |
ping master |
Posted: Fri Aug 01, 2003 6:58 am Post subject: |
|
|
 Centurion
Joined: 20 Sep 2002 Posts: 116 Location: USA
|
after connecting to the queuemanager with accessqmgr, and creating your objects for COMMAND.RESPONSE.LOCAL and SYSTEM.ADMIN.COMMAND.QUEUE (request/replyQueues) make the call to inquire a channel status like this:
responseBag = adminBag.Execute(qMgrObj, 42, optionsBag, requestQueue, replyQueue);
(42=the MQCMD_INQUIRE_CHANNEL_STATUS selector)
$PM |
|
Back to top |
|
 |
HrothgarV |
Posted: Fri Aug 01, 2003 9:10 am Post subject: |
|
|
Novice
Joined: 07 Apr 2003 Posts: 17
|
the problem is the connection handle needed by the mqExecute command. Neither the qmgr.ConnectionHandle nor the qmgr.ObjectHandle work when I used in the mqExecute command. Only when I issued a separate MQCONN command and used the handle obtained from this that the mqExecute command worked.
ping master wrote: |
responseBag = adminBag.Execute(qMgrObj, 42, optionsBag, requestQueue, replyQueue);
(42=the MQCMD_INQUIRE_CHANNEL_STATUS selector)
$PM |
|
|
Back to top |
|
 |
ping master |
Posted: Fri Aug 01, 2003 10:30 am Post subject: |
|
|
 Centurion
Joined: 20 Sep 2002 Posts: 116 Location: USA
|
right.
Don't use qmgr.ConnectionHandle nor the qmgr.ObjectHandle.
use it like this:
var gbl_qMgr = gbl_MQSess.AccessQueueManager(gbl_qMgrName);
THEN
gbl_responseBag = gbl_adminBag.Execute(gbl_qMgr, 42, gbl_optsBag, gbl_requestQueue, gbl_replyQueue);
kinda difficult without seeing what you are coding. I have already wriitten a complete MQ monitoring tool with MQAX.MQAI and it works perfect, I would like to help you. post your code and I can help you better.
$PM |
|
Back to top |
|
 |
HrothgarV |
Posted: Fri Aug 01, 2003 11:15 am Post subject: |
|
|
Novice
Joined: 07 Apr 2003 Posts: 17
|
|
Back to top |
|
 |
HrothgarV |
Posted: Fri Aug 01, 2003 11:27 am Post subject: |
|
|
Novice
Joined: 07 Apr 2003 Posts: 17
|
WAIT.... something's wrong here...
MQAX MQSession.AccessQueueManager returns a queue manager object of type MQQueueManager.
set gbl_qMgr = gbl_MQSess.AccessQueueManager(gbl_qMgrName);
gbl_qMgr is of type MQQueueManager (not Long)...
mqExecute(HConn,,,,,) requires a HConn handle (of type Long).
using gbl_qMgr in mqExecute(HConn,,,) does not work.
ps.... I am doing this in Visual Basic.
ping master wrote: |
right.
Don't use qmgr.ConnectionHandle nor the qmgr.ObjectHandle.
use it like this:
var gbl_qMgr = gbl_MQSess.AccessQueueManager(gbl_qMgrName);
THEN
gbl_responseBag = gbl_adminBag.Execute(gbl_qMgr, 42, gbl_optsBag, gbl_requestQueue, gbl_replyQueue);
kinda difficult without seeing what you are coding. I have already wriitten a complete MQ monitoring tool with MQAX.MQAI and it works perfect, I would like to help you. post your code and I can help you better.
$PM |
|
|
Back to top |
|
 |
ping master |
Posted: Fri Aug 01, 2003 11:35 am Post subject: |
|
|
 Centurion
Joined: 20 Sep 2002 Posts: 116 Location: USA
|
ahh, well, I wrote my programs as web applications and used Javasrcript.
visual basic/ VBscript is very similar
here is the same in VB
Set qm = MQsess.AccessQueueManager("")
Set mqreplybag = mqadminbag.Execute(qm,11,optsbag,requestQ,replyQ)
see???
Last edited by ping master on Fri Aug 01, 2003 11:48 am; edited 1 time in total |
|
Back to top |
|
 |
HrothgarV |
Posted: Fri Aug 01, 2003 11:46 am Post subject: |
|
|
Novice
Joined: 07 Apr 2003 Posts: 17
|
i find it odd that you were able to interchange the MQAX MQQueueManager object and the mqExecute(HConn) in Javascript. They are of 2 different data types. I also do a little javascript/vbscript programming and both of them treat an object datatype (ie, Object, Class) differently from a basic datatype (ie, Long, Integer). And in this case, MQQueueManager is an object, not a simple datatype that you can just use in the mqExecute command.
I may also try to convert my app (once it's done) to a web-service and try your suggestion if it works.
Thanks, |
|
Back to top |
|
 |
ping master |
Posted: Fri Aug 01, 2003 11:49 am Post subject: |
|
|
 Centurion
Joined: 20 Sep 2002 Posts: 116 Location: USA
|
it is so much easier than you are making it. try the above calls that are in VBscript and you will see.
$PM |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|