ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Problem using MQCONNX to remote QueueManager

Post new topic  Reply to topic
 Problem using MQCONNX to remote QueueManager « View previous topic :: View next topic » 
Author Message
c200chello
PostPosted: Tue Aug 21, 2007 7:36 am    Post subject: Problem using MQCONNX to remote QueueManager Reply with quote

Newbie

Joined: 21 Aug 2007
Posts: 5

When I'm using the MQ API (mqm.dll / mqic32.dll) for accessing the local queuemanager everything works fine...

but..

when I try to connect a REMOTE queuemanager (using mqconnx) I ran into several problems. (I'm using mqic32.dll) I think that it has something todo with the proper use of the ConnectionOptions.

Does anayone has a sample of MQCONNX which connects to a remote QM, With te proper use of the connectoptions ? tHX.

Please provide me some example... !



Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Aug 21, 2007 7:42 am    Post subject: Re: Problem using MQCONNX to remote QueueManager Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

c200chello wrote:
Does anayone has a sample of MQCONNX which connects to a remote QM, With te proper use of the connectoptions ? tHX.


There are samples on the install media & on the web. But conceptually there's no difference between a client onto a local queue manager & a remote one, provided both are properly configured to accept client connections.

What problems are you getting, specifically what reason code is being returned from the MQCONNX?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
c200chello
PostPosted: Tue Aug 21, 2007 7:55 am    Post subject: Reply with quote

Newbie

Joined: 21 Aug 2007
Posts: 5

But how on earth do you tell your client appl to connect to a remote QM instead of a local one?

Do I have to set some environment settings like MQSERVER=CLIENT.CHANNEL/TCP/10.20.30.101(1414) ??? or is there another way, because this won't work.

error : MQRC_Q_MGR_NOT_AVAILABLE... MQRC_CD_ERROR (probably channel errors)
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Aug 21, 2007 8:08 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

MQCONNX doesn't use the environment variables.

It expects you set all the necessary information for connecting to the qmgr in the parameters you pass to it.

So you have to give it the Channel name, the hostname/ip, the port number, and etc.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
c200chello
PostPosted: Tue Aug 21, 2007 8:19 am    Post subject: Reply with quote

Newbie

Joined: 21 Aug 2007
Posts: 5

b2w, thx for your reply's

of course I did set both the MQCD (channel) and ConnectOptions, and checked these as during debug, (everything was in it: ipadress(port) channelenames and the default other settings...

but even in the case of having some of the settings wrong or not exactly right, then still I had to see some tcp/ip traffic ... and this is the case: I don't see any attempt to set-up some kind of IP connection... Therefore I'm still thinking some ohter issue is totally wrong ... But I don't have a clue...

Thx for reading !
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Aug 21, 2007 8:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You won't see any network traffic until you get the MQCONNX producting an MQRC that indicates it at least TRIED to talk to the remote qmgr.

That won't happen until you get the structures you're passing in complete enough and correct enough that it doesn't give you RCs complaining about the ConnectOptions.

And as Vitor said, there are examples that show MQCONNX usage.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Tue Aug 21, 2007 12:33 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

On Windows, look in the {MQ_Install_Dir}\Tools\c\Samples\ directory for 'amqscnxc.c'.

It has sample of how to use MQCONNX. It is complex but very straight-forwared.

Code:
   MQCNO    Connect_options = {MQCNO_DEFAULT};
   MQCD     ClientConn = {MQCD_CLIENT_CONN_DEFAULT};
   MQHCONN  Hcon;
   MQLONG   CompCode;
   MQLONG   CReason;
 
   char     QMgrName[MQ_Q_MGR_NAME_LENGTH+1] = "MQA1";
   char     channelName[MQ_CHANNEL_NAME_LENGTH+1] = "SYSTEM.DEF.SVRCONN";
   char     hostname[1024] = "127.0.0.1(1414)";

   strncpy(ClientConn.ConnectionName, hostname, MQ_CONN_NAME_LENGTH);
   strncpy(ClientConn.ChannelName, channelName, MQ_CHANNEL_NAME_LENGTH);

   Connect_options.ClientConnPtr = &ClientConn;
   Connect_options.Version = MQCNO_VERSION_2;

   MQCONNX(QMgrName,
           &Connect_options,
           &Hcon,
           &CompCode,
           &CReason);



Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
PeterPotkay
PostPosted: Tue Aug 21, 2007 1:10 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Roger's solution may do the trick, but this thread reminded me of a problem we had with MQ and ActiveX.

This quote is from an email I had from 2002!
Quote:

| AccessQueueManager method
| Creates a new MQQueueManager object and connects it to a real queue manager
| by means of the MQSeries client or server. As well as performing a connect, this
| method also performs an open for the queue manager object.

| Note: When both the MQSeries server and client are installed on your system
| MQAX applications will always run against the server.


Basically, if an MQSeries Server IS installed on the same machine as the ActiveX program THEN that program will ONLY connect to the local queue manager (unless you tell it to do otherwise - read on).

If you had no local queue manager installed (i.e. using MQ client), it would base the connection on your environment variables (MQSERVER or MQCHLTAB and MQCHLLIB).

Now, you can get around this. If you set a system environment variable GMQ_MQ_LIB to the following, it will behave as a client:
GMQ_MQ_LIB=drive:\<insert path to mqic32>\mqic32.dll.

Hope this helps

_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 21, 2007 1:52 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I won't go into the gorey details of getting a Perl program to connect as a client, on a machine with both client & server - but let's just say that something as *simple* as setting an environment variable sure would be nice.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
c200chello
PostPosted: Tue Aug 21, 2007 8:38 pm    Post subject: Reply with quote

Newbie

Joined: 21 Aug 2007
Posts: 5

Thanks for all your help!

I do now have several leads o solve my issue with MXCONNX.

After a lot of reading I figured out that you need to make use (client connect) of mqic32.dll for a remote connction instead of using mqm.dll for a local one.

But according this Forum if it is also possible to use MQCONN also for a remote connect but then you have to set a local Environmet variable like MQSERVER=channel-name/TCP/Hostname(por) to force it.

Today I'm going through on all these possibilities to find out....

Thx !
Back to top
View user's profile Send private message Send e-mail
c200chello
PostPosted: Wed Aug 22, 2007 6:56 am    Post subject: Reply with quote

Newbie

Joined: 21 Aug 2007
Posts: 5

My problem is solved..!

I'm using the client libs of MQ v6.0

when I changed the following statement in my coding

Connect_options.Version = MQCNO_VERSION_2;

into Connect_options.Version = 7;

suddenly the MQCONNX works fine ...!

Thanks for helping and reading !
Back to top
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Thu Aug 23, 2007 7:56 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

c200chello wrote:
into Connect_options.Version = 7;

suddenly the MQCONNX works fine ...!

Seven
Where did you get seven from? You really should be using the IBM supplied constants of MQCNO_VERSION_*

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Thu Aug 23, 2007 12:24 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

RogerLacroix wrote:
Seven
Where did you get seven from? You really should be using the IBM supplied constants of MQCNO_VERSION_*


!



http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzao.doc/mi10500_.htm

The things you learn by reading the manuals...


_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Problem using MQCONNX to remote QueueManager
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.