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 » Client connection problems

Post new topic  Reply to topic
 Client connection problems « View previous topic :: View next topic » 
Author Message
cmkeller
PostPosted: Sun Jan 09, 2005 9:51 pm    Post subject: Client connection problems Reply with quote

Apprentice

Joined: 09 Jan 2005
Posts: 41
Location: Queens, NY

I have an application that I wrote using MQI C++ classes which can use a client connection to get and put messages from and to a queue. I use ImqQueueManager::setChannelReference and everything works fine.

I now need to do some operations with the MQAI mqExecute function on the queue manager that I'm accessing via the client connection. In order to get a handle, I'm trying to use MQCONNX, but it's failing every time with error 2058. The following is the code I use:

Code:
MQCNO         lmqod_conn_options = {MQCNO_DEFAULT};
MQCD         lmqod_channel_def = {MQCD_CLIENT_CONN_DEFAULT};

strcpy(lmqod_channel_def.ChannelName, (MQCHAR *) imqod_channel->channelName());
lmqod_channel_def.HeartbeatInterval = imqod_channel->heartBeatInterval();
strcpy(lmqod_channel_def.ConnectionName, (MQCHAR *) imqod_channel->connectionName());
lmqod_channel_def.TransportType = imqod_channel->transportType();

lmqod_conn_options.Version = MQCNO_CURRENT_VERSION;
lmqod_conn_options.ClientConnOffset = 0;
lmqod_conn_options.ClientConnPtr = &lmqod_channel_def;

MQCONNX(imqod_queue_mgr->name(), &lmqod_conn_options, &lmqh_connection_handle, &lmql_completion_code, &lmql_reason_code);


I also compiled the sample program amqscnxc.c and tried running it, and got the same error (2058) in failure. I know the names I'm using for host, channel and queue mgr are correct, because these same names work when I use the C++ class mentioned above - that's the "imqod" you see in the code snippet above. Any idea what I'm missing here?

(I'm using Websphere MQSeries 5.3 in a Windows XP environment)

Thanks so very much.
_________________
Chaim Mattis Keller
Shadow Financial Services Corp
ckeller@shadowfinancial.com
Back to top
View user's profile Send private message Send e-mail
mqmhr
PostPosted: Sun Jan 09, 2005 10:03 pm    Post subject: Reply with quote

Centurion

Joined: 28 Dec 2004
Posts: 105

Specify the TCP port number as well. Ensure that a listener is running at this port and that the server connection channel is started.
Back to top
View user's profile Send private message
cmkeller
PostPosted: Mon Jan 10, 2005 6:28 am    Post subject: Reply with quote

Apprentice

Joined: 09 Jan 2005
Posts: 41
Location: Queens, NY

How do I specify port number? <host name>:<port number> for connection name?
_________________
Chaim Mattis Keller
Shadow Financial Services Corp
ckeller@shadowfinancial.com
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Mon Jan 10, 2005 6:42 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

cmkeller wrote:
How do I specify port number? <host name>:<port number> for connection name?


Port numbers in connection names are always enclosed in parentheses.

So <host name>(<port number>).
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
cmkeller
PostPosted: Mon Jan 10, 2005 7:26 am    Post subject: Reply with quote

Apprentice

Joined: 09 Jan 2005
Posts: 41
Location: Queens, NY

Well, I tried that (adding "(1414)" to my connection name) and it didn't change a thing.

I think there's got to be some value that's defaulted or properly set in ImqChannel or ImqQueueManager::SetChannelReference which is not being set when I try to use the raw form of MQCONNX. The connection works the C++ way, I successfully get and put messages! But I need that HCONN handle, without it I can't use the mqExecute function.
_________________
Chaim Mattis Keller
Shadow Financial Services Corp
ckeller@shadowfinancial.com
Back to top
View user's profile Send private message Send e-mail
cmkeller
PostPosted: Mon Jan 10, 2005 7:44 am    Post subject: Reply with quote

Apprentice

Joined: 09 Jan 2005
Posts: 41
Location: Queens, NY

Oh, and I should add: I checked the status of the server connection channel. On MQ Explorer, the channel status says it's inactive, but when I right-click and select "Start", that does nothing. In addition, the fact that it's (supposedly) inactive doesn't hurt anything when I'm using the C++ object to make the connection.
_________________
Chaim Mattis Keller
Shadow Financial Services Corp
ckeller@shadowfinancial.com
Back to top
View user's profile Send private message Send e-mail
rajesh_avrs
PostPosted: Sun Feb 20, 2005 4:07 pm    Post subject: Reply with quote

Apprentice

Joined: 18 May 2001
Posts: 31

The system where you are running the application, do you have MQSERVER environment variable set? If yes, remove it and try running your code.
_________________
****************
MQSeries is cool
****************
Back to top
View user's profile Send private message Send e-mail
cmkeller
PostPosted: Mon Feb 21, 2005 10:42 am    Post subject: Reply with quote

Apprentice

Joined: 09 Jan 2005
Posts: 41
Location: Queens, NY

Thanks for the late reply. I since found the problem - I had been linking my app to the server library, mqm.lib, instead of the client library mqic32.lib. It now works just fine.
_________________
Chaim Mattis Keller
Shadow Financial Services Corp
ckeller@shadowfinancial.com
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Tue Feb 22, 2005 2:42 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

rajesh_avrs wrote:
The system where you are running the application, do you have MQSERVER environment variable set? If yes, remove it and try running your code.

AFAIK, this shouldn't really matter
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Client connection problems
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.