|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to use MQAX to connect to different MQ server dynamicly? |
« View previous topic :: View next topic » |
Author |
Message
|
tony.ye |
Posted: Thu Feb 24, 2005 3:51 am Post subject: How to use MQAX to connect to different MQ server dynamicly? |
|
|
Newbie
Joined: 24 Feb 2005 Posts: 3
|
I'm using MQAX200 to develop a MQ adapter using VB6.
The requirement is that if it fails to connect primary MQ server, it should try to connect to secondary MQ server.
Client is running on Windows 2000 professional.
MQ Server is a Windows Server.
I don't know how to implement this.
Need your help. Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 24, 2005 6:46 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Your requirement is your answer. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
tony.ye |
Posted: Thu Feb 24, 2005 5:42 pm Post subject: |
|
|
Newbie
Joined: 24 Feb 2005 Posts: 3
|
As I know, the server channel is defined in MQServer windows enviroment variable.
MQSERVER=channel_name/tcp/tcp_name
I tried to change Windows variable MQSERVER by calling API, but it didn't work.
Is there any way to set MQServer, channel and port in program? |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu Feb 24, 2005 6:42 pm Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
The answer is "yes" but what language are you using?
I have an example in VB.Net and I will post tomorrow when I am at work.
The MQ Client manual has other language examples I believe.
ps. I have just searched on the net and it appears that in Java you do :
Code: |
MQEnvironment.hostname = "host.domain.com";
MQEnvironment.channel = "java.client.channel";
|
|
|
Back to top |
|
 |
tony.ye |
Posted: Thu Feb 24, 2005 6:59 pm Post subject: |
|
|
Newbie
Joined: 24 Feb 2005 Posts: 3
|
Using Visual Basic 6 and MQAX200 |
|
Back to top |
|
 |
rajesh_avrs |
Posted: Thu Feb 24, 2005 11:06 pm Post subject: |
|
|
Apprentice
Joined: 18 May 2001 Posts: 31
|
Tony,
You can not set the HostName, Channel & Port in your VB Program like you can do in Java or .NET languages.
In the good old C++ and VB the only of achieving what you want is to use MQCHLLIB & MQCHLTAB environment variables.
Basically, you need to create a Channel Table file containing two entries, first one pointing to your primary server and second one pointing to your secondary server.
While creating the channel table file, ensure you specify the SAME queue manager (let's say XYZ) in both the Primary Server connection channel and the Secondary connection channel.
From the client code, while issuing MQCONN, specify the Queue Manager name as *XYZ. Note the *, it does something special.
It's a long stuff to be explained here. But if you need more detais, I would suggest you to get the MQ Clients manual. There is a whole section dedicated for creating and using Channel Table files.
Even though this solution satisfies your requirement, please be advised that this is not the best High Availability solution.
There are so many other ways of doing this (ofcourse, you have to spend money on hardware, configuration etc.,)
Cheers,
Rajesh _________________ ****************
MQSeries is cool
**************** |
|
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
|
|
|
|