Author |
Message
|
shankycheil |
Posted: Fri Aug 11, 2006 2:49 am Post subject: Accessing multiple QM's running on a single machine (2085) |
|
|
Newbie
Joined: 11 Aug 2006 Posts: 9
|
Hello All,
A newbie on MQ (I do dot net programming for a living)
I have a test system (Windows Server 2003) with MQ 6.0 running.
In addition to the default QM, I have created multiple QM's on the same machine (different ports for different listeners) which are working fine.
Between two such non-default QM's I have created a series of local & remote Q's, transmission Q's, sender & receiver channels. I have tested the message transmission in this setup using the message put options available in the WebSphere MQ Explorer.
However, I get a 2085 message when I try to access a queue in any of the non-default QM's using the MQQueueManager.AccessQueue call. The calls to MQQueueManager (new) and subsequent Open calls are successfull.
No errors logged anywhere (MQ, Event Viewer)
Please provide some guidance.
Regards. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 11, 2006 2:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
How are you connecting to the non-default queue managers? Using
MQQueueManager("QMGR",etc,etc) or MQENvironment?
It sounds a lot like your connection is always ending up on the defualt queue manager to me. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shankycheil |
Posted: Fri Aug 11, 2006 4:24 am Post subject: |
|
|
Newbie
Joined: 11 Aug 2006 Posts: 9
|
Hi Vitor,
Thank you for your prompt response.
I'm using the following code. I could not find an example of using MQEnvironment to do the same.
Try
m_oMQQueueManager = New MQQueueManager(txtSendingQM.Text, MQC.MQCNO_STANDARD_BINDING)
m_oMQQueueManager.Connect()
'
' Name of the Queue
m_oMQQueue = m_oMQQueueManager.AccessQueue(txtSendingQueue.Text, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_OUTPUT)
oMQMessage = New MQMessage
oMQMessage.Write(byMessageBuffer)
'
m_oMQQueue.Put(oMQMessage)
DisplayMessage(byMessageBuffer)
'
m_oMQQueue.Close()
m_oMQQueueManager.Disconnect()
Catch ex As MQException
'
MessageBox.Show("Reason Code [" & ex.ReasonCode.ToString() & "]" & vbCrLf & "Completion Code [" & ex.CompletionCode.ToString() & "]" & vbCrLf & ex.Message)
Finally
If Not oMQMessage Is Nothing Then
oMQMessage.ClearMessage()
oMQMessage = Nothing
End If
'
m_oMQQueue = Nothing
m_oMQQueueManager = Nothing
End Try |
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 11, 2006 4:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I notice the MQQueueManager constructor is not passed either a connection name or a channel name - is this deliberate?
Are the non-default queue manager(s) local to the application machine, and does this differ from the placement of the default queue manager?
What is your value of NMQ_MQ_LIB? Do you expect your application to connect as a client or server side?
(Probably should have asked these questions last time ) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shankycheil |
Posted: Fri Aug 11, 2006 4:37 am Post subject: |
|
|
Newbie
Joined: 11 Aug 2006 Posts: 9
|
Hi Vitor,
As an update, you're quiet right in your statement that I seem to be connecting to the default QM because after the m_oMQQueueManager.Connect() call if I do the m_oMQQueueManager.Name I do get the default QM's name
.. I shall try the MQEnvironment option and post results unless you have some sample code I could attempt ?
Regards. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 11, 2006 4:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I thought you were. Pls see my previous post re: queue manager placement & connection method. I suspect (and I'm somewhat guessing here) that without a connection or a channel it can't find the queue manager you're asking for & is just connecting to the default because it's the default! (When all else fails.... )
This is why I don't approve of default queue managers. If it wasn't the default you'd have got a 2058 & realised what the problem was.
It's a question of what you're trying to achieve really. MQEnvironment is no better and no worse than a fully qualified constructor. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shankycheil |
Posted: Fri Aug 11, 2006 4:44 am Post subject: |
|
|
Newbie
Joined: 11 Aug 2006 Posts: 9
|
posted while you were trying to respond
I'll try and answer your Q's..
>> I notice the MQQueueManager constructor is not passed either a >> connection name or a channel name - is this deliberate?
It is my ignorance. The intellisence popped up about 6 options, I selected one I had answers for
>> Are the non-default queue manager(s) local to the application >> machine, and does this differ from the placement of the default >> queue manager?
Yes they are all local to the same machine. Running on different port no's.
>> What is your value of NMQ_MQ_LIB? Do you expect your application >> to connect as a client or server side?
I wouldn't know how to get the NMQ_MQ_LIB value
However, the application will connect to all the QM's from the server side. One machine for demo, lots of QM's.. one app.... to send to a remote Q on QM1 and pick it up from a local Q on QM2... demo something and try some things. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 11, 2006 4:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Right, now we're geting some place....
First, before you go any further spend some time with the Using .Net manual (or online equivalent). This contains far wider & deeper information than the intellinonsense and will enable you to make an informed choice about how you plan to connect your application. Particually it will explain about NMQ_MQ_LIB, which will simplify your life immensely as it's heavily involved in .NET connectivity. It will also explain the MQEnvironment object & why you'd choose between the 2 methods.
IMHO you should connect as a client. Allows your application to run in more places. But you may wish to stay server side during the demo process.
Secondly, and if you decide you agree with me, check out the Clients manual. This will explain the various ways of establishing a client connection including things like SVRCONN channels (hint!). Once you have got these sorted you'll be away.
Happy Reading!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shankycheil |
Posted: Fri Aug 11, 2006 6:43 am Post subject: |
|
|
Newbie
Joined: 11 Aug 2006 Posts: 9
|
Hi Vitor,
Thank you for the references. I did some more research using the MQEnvironment call and am now getting a "The applicaiton failed to start because amqzsaic.dll was not found." In the application I catch an application error regarding failure to load "mqic32.dll". This through documentation I was able to translate into "The client is not installed "???
So I guess I have a long way to go
Regards. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 11, 2006 6:54 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
In order to use MQEnvironment to specify a hostname, channel and port, you have to use the MQ Client.
In order to use the MQ Client, you have to a)have the client installed, and b)set NMQ_MQ_LIB to the right value.
If all your queue managers are local, you don't need to specify a hostname, channel and port.
You can just specify the queue manager name. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
shankycheil |
Posted: Fri Aug 11, 2006 7:38 am Post subject: SOLVED |
|
|
Newbie
Joined: 11 Aug 2006 Posts: 9
|
Hi Victor,
Thank you ever so much.
I installed the client component and modified the code to include
m_oMQEnvironment.Hostname = <myservername>
m_oMQEnvironemnt.Port = <the port my non-default QM was running on>
m_oMQEnvironment.Channel = <the Server Channel I created on that QM>
'
m_oMQQueueManager = New MQQueueManager(<name of the QM>)
..
..
The rest of the code did not require modification.
BUT - Whooo Haaa..... it worked. I could access the non-default QM and the queue... read & write messages onto it.
Thank you, Thank you again ! |
|
Back to top |
|
 |
Vitor |
Posted: Fri Aug 11, 2006 1:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Well done for getting it working. Probably should have included "install the client" as part of my recommendation for using it!
But so long as it's working.
(Keep reading the manuals!) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|