|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Connection error 2009 during Get (VB using COM) |
« View previous topic :: View next topic » |
Author |
Message
|
Ray |
Posted: Tue Nov 20, 2001 1:19 pm Post subject: |
|
|
Newbie
Joined: 19 Nov 2001 Posts: 2
|
Hi,
I am new to MQSeries and I am getting a reason code 2009 (queue manager connection broken) when the Get method is executed on a Dynamic queue opened for input. Would someone please help me out? Thanks!
Here's an excerpt of the VB code:
Function getPrices (qsess As MQSession, putq As MQQueue, getq As MQQueue, qmgr As MQQueueManager) As String
Dim getmsg As MQMessage
Dim gmo As MQGetMessageOptions
Dim msg As String
Set getmsg = New MQMessage
Set gmo = New MQGetMessageOptions
gmo.MatchOptions = MQMO_NONE
gmo.Options = MQGMO_NO_WAIT
gmo.Options = gmo.Options + MQGMO_NO_SYNCPOINT
gmo.Options = gmo.Options + MQGMO_ACCEPT_TRUNCATED_MSG
gmo.Options = gmo.Options + MQGMO_FAIL_IF_QUIESCING
If qmgr.IsConnected = True Then
If getq.IsOpen = True Then
If getq.CurrentDepth > 0 Then
getq.Get getmsg, gmo
msg = getmsg.ReadString(getmsg.MessageLength)
End If
Else
MsgBox "get queue not open"
End If
Else
MsgBox "queue manager not opened"
End If
getPrices = msg
Set getmsg = Nothing
Set gmo = Nothing
End Function |
|
Back to top |
|
 |
kolban |
Posted: Tue Nov 20, 2001 2:28 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
I think we are going to have to also see how you access the Session, Queues and QueueManager objects. Also, is the queue manager on the same machine or a remote machine. |
|
Back to top |
|
 |
Ray |
Posted: Tue Nov 20, 2001 2:43 pm Post subject: |
|
|
Newbie
Joined: 19 Nov 2001 Posts: 2
|
Thank you for responding. The Queue Manager is on a remote machine. I am running Windows NT 4.0. Only the MQ Series Client is installed. I am using two environment variables MQCHLLIB and MQCHLTAB.
Heres the complete VB prototype code:
Private Sub Form_Load()
Dim qsess As MQSession
Dim qmgr As MQQueueManager
Dim putq As MQQueue
Dim getq As MQQueue
Dim msg As String
Set qsess = CreateObject("MQAX200.MqSession")
Set qmgr = qsess.AccessQueueManager("QM.JEKYL_JEF.01")
Set putq = qmgr.AccessQueue("QL.MDS.REQUEST.GENERAL", MQOO_OUTPUT, "QM.JEKYL_JEF.01")
Set getq = qmgr.AccessQueue("QD.CLIENT.REPLY", MQOO_INPUT_SHARED + MQOO_INQUIRE, "QM.JEKYL_JEF.01", "AMQ*", "")
Call ILXSubscribe(qsess, putq, getq)
msg = getPrices(qsess, putq, getq, qmgr)
putq.Close
getq.Close
qmgr.Disconnect
Set qmgr = Nothing
Set qsess = Nothing
Unload Me
End Sub
Sub ILXSubscribe(qsess As MQSession, putq As MQQueue, getq As MQQueue)
Dim putmsg As MQMessage
Dim pmo As MQPutMessageOptions
Set putmsg = qsess.AccessMessage()
Set pmo = qsess.AccessPutMessageOptions()
pmo.Options = pmo.Options + MQPMO_NO_SYNCPOINT
putmsg.ReplyToQueueManagerName = getq.Name
putmsg.Format = "MQSTR"
putmsg.CorrelationId = "1 "
putmsg.WriteString "5004=1.0 5005=5 5007=144 5049=1000001 5046=34463 6067=SELECT 6027,6020,6001,6002,6053,6005,6006,6008,6009 WHERE 6027 = CSCO"
putq.Put putmsg, pmo
Set putmsg = Nothing
Set pmo = Nothing
End Sub
Function getPrices(qsess As MQSession, putq As MQQueue, getq As MQQueue, qmgr As MQQueueManager) As String
Dim getmsg As MQMessage
Dim gmo As MQGetMessageOptions
Dim msg As String
Set getmsg = New MQMessage
Set gmo = New MQGetMessageOptions
gmo.MatchOptions = MQMO_NONE
gmo.Options = MQGMO_NO_WAIT
gmo.Options = gmo.Options + MQGMO_NO_SYNCPOINT
gmo.Options = gmo.Options + MQGMO_ACCEPT_TRUNCATED_MSG
gmo.Options = gmo.Options + MQGMO_FAIL_IF_QUIESCING
If qmgr.IsConnected = True Then
If getq.IsOpen = True Then
If getq.CurrentDepth > 0 Then
getq.Get getmsg, gmo
msg = getmsg.ReadString(getmsg.MessageLength)
End If
Else
MsgBox "get queue not open"
End If
Else
MsgBox "queue manager not opened"
End If
getPrices = msg
Set getmsg = Nothing
Set gmo = Nothing
End Function
|
|
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
|
|
|
|