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 » Issue : Connecting to remote Queue manager

Post new topic  Reply to topic
 Issue : Connecting to remote Queue manager « View previous topic :: View next topic » 
Author Message
yasaboy
PostPosted: Mon Jul 14, 2014 11:33 pm    Post subject: Issue : Connecting to remote Queue manager Reply with quote

Voyager

Joined: 23 Jun 2014
Posts: 90

Hi,

I am experiencing a rather weird set of results when trying to connect to a queue manager, using MQCD. I tried to connect to local Queue manager by giving the host and port of it.

LocalHost - 172.25.83.xx
port - 20501
Qmanager - AAAAA
Queue - BBBBB


But no matter what ever the host name , port and channel I add it connect to the local queue BBBBB in manager AAAAA.

Code:
MQCD connectionDescriptor = {MQCD_CLIENT_CONN_DEFAULT}; /* Client connection channel */
   strcpy(connectionDescriptor.ConnectionName , "172.00.00.000(AnyValue)");
   strcpy(connectionDescriptor.ChannelName, channel);
   connectionDescriptor.TransportType = MQXPT_TCP;
   connectionDescriptor.Version = MQCD_VERSION_4;

   MQCNO cno = {MQCNO_DEFAULT};
   cno.Options = MQCNO_HANDLE_SHARE_BLOCK ;

   PMQCD pMQCD   = &connectionDescriptor;
   cno.ClientConnPtr = pMQCD;
   cno.Version = MQCNO_VERSION_2;

   strcpy(QMgrName,"AAAAA");
   MQCONNX(QMgrName, &cno ,&Hcon, &CompCode, &CReason);
   MOD_EXIT:

   // Open Queues 
   MQOD     od = {MQOD_DEFAULT};
   O_options = MQOO_INPUT_AS_Q_DEF|MQOO_FAIL_IF_QUIESCING;
   

   strcpy(od.ObjectName, "BBBBB");
   MQOPEN(Hcon, &od, O_options, &Hobj, &OpenCode, &Reason);


My ultimate goal of mine is to connect to a remote queue in a different host and a channel. However it seems like the host and port parameters are not properly set by the connection.

Please help me with this, Thanks .
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Tue Jul 15, 2014 3:12 am    Post subject: Reply with quote

Grand Master

Joined: 17 Nov 2005
Posts: 1002
Location: New Zealand

Are you certain that you've linked this application to the client library (eg. libmqic or mqic23.dll) rather than the QM (libmqm or mqm.dll) ?

Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
yasaboy
PostPosted: Tue Jul 15, 2014 11:06 pm    Post subject: Reply with quote

Voyager

Joined: 23 Jun 2014
Posts: 90

PaulClarke wrote:
Are you certain that you've linked this application to the client library (eg. libmqic or mqic23.dll) rather than the QM (libmqm or mqm.dll) ?

Cheers,
Paul.


Hi,

@Paul thank you very much for replying. I could found and resolve the issue by adding "lmqic_r" library. Anyway way as I understood
Code:
#include <cmqxc.h>
is linked with "mqic" is it so ?

Now I use
Code:
"-limqs23gl_r" , "-limqb23gl_r" , "-lmqic_r" , "-lmqm_r"
all libraries. Tobe honest no idea exactly what doing what even if the code is qorking fine. Anyway "_r" is for the recursive version since we are using a multi threaded MQCB mecanism.

can you explain the generic usage of these libries.
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Tue Jul 15, 2014 11:31 pm    Post subject: Reply with quote

Grand Master

Joined: 17 Nov 2005
Posts: 1002
Location: New Zealand

The various libraries are explained in the manuals but essentially '*mqm*' is for locally bound applications. '*mqic*' is for client bound applications. The _r variants are for threaded applications which, as you suggest, you need if you are using async. consume.

Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
gbaddeley
PostPosted: Wed Jul 16, 2014 3:33 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
Location: Melbourne, Australia

The C language #includes for MQ do not dictate the connection mode, they only provide structures, defined constants and function prototypes. Both Client and Binding mode connections can use the same MQI functions. MQ makes the choice depending on the libraries that are chosen to be loaded, *mqm* or *mqic*.
_________________
Glenn
Back to top
View user's profile Send private message
yasaboy
PostPosted: Thu Jul 17, 2014 2:11 am    Post subject: Reply with quote

Voyager

Joined: 23 Jun 2014
Posts: 90

@ paul & glenn . Thanks
Back to top
View user's profile Send private message
yasaboy
PostPosted: Thu Jul 17, 2014 3:25 am    Post subject: Reply with quote

Voyager

Joined: 23 Jun 2014
Posts: 90

Hi,
sorry for reopening this. Another quick question here.

I forgot to mention that I altered the settings of my Queue to make the CONNX connection authorized to access the queue. Those changes are

Code:
DEFINE CHANNEL (MY.CHANNEL) CHLTYPE (svrconn) TRPTYPE (tcp) [b]MCAUSER('mqm')[/b]
alter qmgr [b]CHLAUTH(DISABLED)[/b];


since I got MQRC_NOT_AUTHORIZED error 2035. But I never needed the Host user name Host password fields. Why isn't it needed to login to the 172.xx.xx.xxx. I think there is no attribute in MQCD connectionDescriptor; to set those values as well

Isn't it ?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jul 17, 2014 3:43 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Giving a Channel an MCAUSER=mqm is just asking for trouble. This means that anyone connecting over that channel can do anything they want to any MQ Object in the queue manager.

MQ passes the current user id are part of the connection request. MQ Then checks to see if that user is authorized. No password needed.

The Security forum on this site has lots and lots of discussions about this sort of thing.

You could create a user and give that user the access it needs to the QMGR, Channel and relevant queues. Then in your CHLAUTH rule you could assing the MCAUSER to that user if the request comes from one or more know IP Addresses. There are other ways to enable the sort of security you are after as well.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jul 17, 2014 5:44 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

smdavies99 wrote:

MQ passes the current user id are part of the connection request. MQ Then checks to see if that user is authorized. No password needed.


Unless you use MQ V8 and a security policy that requires a password.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Thu Jul 17, 2014 6:09 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

fjb_saper wrote:


Unless you use MQ V8 and a security policy that requires a password.


Indeed but... I was trying to point out that there are other ways to do this sort of thing and that setting the MCAUSR to 'mqm' is a bad idea. Besides, how many are actively using V8 in anything but a POC/Test setup ?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
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 » Issue : Connecting to remote Queue manager
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.