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 » General IBM MQ Support » amqsputc fails

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 amqsputc fails « View previous topic :: View next topic » 
Author Message
Inforz
PostPosted: Sun Dec 07, 2014 10:24 am    Post subject: amqsputc fails Reply with quote

Centurion

Joined: 15 Apr 2011
Posts: 139
Location: Chennai, India

On RHEL Linux OS, I am trying to use the ccdt(AMQCLCHL.TAB) of QM1 to connect to QM2's queue to drop msg as a client. So I did the following

ON QM1,
I created a clntconn as follows
def chl(qm1.clnt) chltype(clntconn) conname('localhost(10002)') trptype(tcp) qmname(QM1)
QM1: listener running on port 10001

ON QM2,
I created a svrconn as follows
def chl(qm1.clnt) chltype(svrconn) trptype(tcp)
def ql(QL)
QM2: listener running on port 10002

Now I copied the AMQCLCHL.TAB file from @ipcc folder of QM1 to /tmp/ccdt/ and
exported below env variables,
EXPORT MQCHLLIB=/tmp/ccdt
EXPORT MQCHLTAB=AMQCLCHL.TAB
and unset/nullified MQSERVER and MQCLNTCF vairables(by setting them to '')

Now I tried,
amqsputc LQ QM1

which fails with mqrc 2058, and when checked in MQ general logs(/var/mqm/errors), I see

The value of the MQSERVER environment variable was ''. The variable should be in the format 'ChannelName/Protocol/ConnectionName'.

I assumed MQCHLLIB is preceded by MQSERVER variable. But getting the above error.
Can you please help on sorting this.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun Dec 07, 2014 11:13 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.

Are you trying to connect QM1 to QM2 so that you can put a message to a queue on QM1 and have it sent to a queue on QM2?

If this is correct then you MUST set up a SDR/RCVR channel pair between the two queue managers.
the CCDT file , SVRCONN and CLNTCON channels are not used for this.
_________________
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
PaulClarke
PostPosted: Sun Dec 07, 2014 12:20 pm    Post subject: Reply with quote

Grand Master

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

If I understand you correctly you are trying to connect a client to QM2. Therefore I would have thought have thought that you ought to named the channel qm2.clnt. You also should use a qmname attribute of QM2.

Therefore the channel should be....

def chl(qm2.clnt) chltype(clntconn) conname('localhost(10002)') trptype(tcp) qmname(QM2)

clearly you should also change the svrconn.

Then the AMQSPUTC command would be....

amqsputc LQ QM2

Forgive me if I've misunderstaood what you are trying to do.

Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Sun Dec 07, 2014 1:15 pm    Post subject: Re: amqsputc fails Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Inforz wrote:

...
EXPORT MQCHLLIB=/tmp/ccdt
EXPORT MQCHLTAB=AMQCLCHL.TAB


Did the UNIX export commands succeed in UPPER-CASE? UNIX commands are case-sensitive?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
exerk
PostPosted: Sun Dec 07, 2014 2:23 pm    Post subject: Re: amqsputc fails Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Inforz wrote:
def chl(qm1.clnt) chltype(clntconn) conname('localhost(10002)') trptype(tcp) qmname(QM1)

Your CLNTCONN channel will be named QM1.CLNT as you have not quote-enclosed its name, so it will wrap to upper case...

Inforz wrote:
def chl(qm1.clnt) chltype(svrconn) trptype(tcp)
def ql(QL)

...and ditto your SVRCONN channel

This may seem nit-picking but I've seen many people do what you have done, i.e. put one unquoted attribute in lower case and another unquoted attribute in upper case, and be convinced that the case has not changed. It is, in my opinion - others may differ - best to adopt a practice of either quoting all string-value attributes, or using the same case for all string value attributes.

As regards the rest of your problem, I echo my learned colleagues questions and would add that when setting variables it's also a good idea to echo them back to check that what you think has been set has actually been set.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
Inforz
PostPosted: Sun Dec 07, 2014 5:56 pm    Post subject: Reply with quote

Centurion

Joined: 15 Apr 2011
Posts: 139
Location: Chennai, India

smdavies99 wrote:
Are you trying to connect QM1 to QM2 so that you can put a message to a queue on QM1 and have it sent to a queue on QM2?

If this is correct then you MUST set up a SDR/RCVR channel pair between the two queue managers.
the CCDT file , SVRCONN and CLNTCON channels are not used for this.


Yes I am trying to connect from QM1 to QM2, but as client which is the requirement.
Back to top
View user's profile Send private message
Inforz
PostPosted: Sun Dec 07, 2014 6:19 pm    Post subject: Reply with quote

Centurion

Joined: 15 Apr 2011
Posts: 139
Location: Chennai, India

PaulClarke wrote:
If I understand you correctly you are trying to connect a client to QM2. Therefore I would have thought have thought that you ought to named the channel qm2.clnt. You also should use a qmname attribute of QM2.

Therefore the channel should be....

def chl(qm2.clnt) chltype(clntconn) conname('localhost(10002)') trptype(tcp) qmname(QM2)

clearly you should also change the svrconn.

Then the AMQSPUTC command would be....

amqsputc LQ QM2

Forgive me if I've misunderstaood what you are trying to do.

Cheers,
Paul.


Paul, actually my requirement is to connect from QM1 to QM2, but as client, in other words use CCDT of QM1 to connect to QM2's local queue to drop a msg into to as a client.

Also I have another question, which of the below option is the correct way to make an entry into qm1's CCDT other than manual edit
1. create a clntconn chl in qm1(and corresponding svrconn in qm2)
2. use m072 util and define a clntconn chl for qm1

In the first case above, after clntconn creation, when I give a dis chl(*) in mo72 util(running mo72 in client mode ie., $ mqsc -n -t <ccdt location>), I get "Segmentation fault" as output.
At the same time if I go for option 2, the dis chl(*) inside the util mo72 gives the channel details, but when given dis chl(*) inside the qmgr (with runmqsc), the chl aint getting displayed.
Please explain the above.
Back to top
View user's profile Send private message
Inforz
PostPosted: Sun Dec 07, 2014 6:21 pm    Post subject: Re: amqsputc fails Reply with quote

Centurion

Joined: 15 Apr 2011
Posts: 139
Location: Chennai, India

bruce2359 wrote:
Inforz wrote:

...
EXPORT MQCHLLIB=/tmp/ccdt
EXPORT MQCHLTAB=AMQCLCHL.TAB


Did the UNIX export commands succeed in UPPER-CASE? UNIX commands are case-sensitive?


Exactly, sorry for the casing. I actually, gave 'export' in lower-case.
Back to top
View user's profile Send private message
Inforz
PostPosted: Sun Dec 07, 2014 6:22 pm    Post subject: Re: amqsputc fails Reply with quote

Centurion

Joined: 15 Apr 2011
Posts: 139
Location: Chennai, India

exerk wrote:
Inforz wrote:
def chl(qm1.clnt) chltype(clntconn) conname('localhost(10002)') trptype(tcp) qmname(QM1)

Your CLNTCONN channel will be named QM1.CLNT as you have not quote-enclosed its name, so it will wrap to upper case...

Inforz wrote:
def chl(qm1.clnt) chltype(svrconn) trptype(tcp)
def ql(QL)

...and ditto your SVRCONN channel

This may seem nit-picking but I've seen many people do what you have done, i.e. put one unquoted attribute in lower case and another unquoted attribute in upper case, and be convinced that the case has not changed. It is, in my opinion - others may differ - best to adopt a practice of either quoting all string-value attributes, or using the same case for all string value attributes.

As regards the rest of your problem, I echo my learned colleagues questions and would add that when setting variables it's also a good idea to echo them back to check that what you think has been set has actually been set.


Agreed. And have kept in mind while executing commands. But am sometimes in to lazy mode ,
And yes I did echoed the variables MQCHLLIB and MQCHLTAB and it did displayed the location and ccdt names as expected.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Dec 07, 2014 7:33 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Inforz wrote:
... actually my requirement is to connect from QM1 to QM2, but as client, in other words use CCDT of QM1 to connect to QM2's local queue to drop a msg into to as a client.

Qmgrs transmit messages to other qmgrs across non-client channels.

Applications bound with MQ Client bindings "send" messages with MQPUT command using mqclient.ini, MQCHLLIB= and MQCHLTAB=, or MQSERVER= environment variables.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Inforz
PostPosted: Sun Dec 07, 2014 9:09 pm    Post subject: Reply with quote

Centurion

Joined: 15 Apr 2011
Posts: 139
Location: Chennai, India

Ok, or this pic am referring could explain what I trying to do
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Dec 07, 2014 10:06 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Please tell us where you found the graphic. What URL?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Dec 07, 2014 10:15 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

The graphic you posted is found here http://www-01.ibm.com/support/docview.wss?uid=swg27024109&aid=1

I believe you have misinterpreted the graphic.

Host1 hosts the one and only qmgr (QMGR1) in the graphic. Host 2 does not have a qmgr.

Host2 has a client-bindings app APPL1 that MQCONNects to Host1 QMGR1 with MQCHLLIB and MQCHLTAB environment variables.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Dec 07, 2014 10:18 pm    Post subject: Reply with quote

Grand High Poobah

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

But according to your graphic the conname on the client channel CANNOT be localhost, as the qmgr is on a different host compared to the client application.

So you will never be able to connect to QM1 on HOST1 with that client definition from HOST2
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Inforz
PostPosted: Sun Dec 07, 2014 10:41 pm    Post subject: Reply with quote

Centurion

Joined: 15 Apr 2011
Posts: 139
Location: Chennai, India

bruce2359, but what does the texts "QM3" imply in the graphic. Its confusing now.
fjbsaper, I am just using the idea on the graphic but my requirement is to achieve on the same host.
As of now, to try the basic test, I am just creating svrconn,clntconn pair for QM1, copy its CCDT file and place in say /tmp/ccdt and referring it to MQCHLLIB. MQSERVER and MQCLNTCF are null. And still I get 2058 for amqsputc LQ QM1
(lstr running for QM1)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » General IBM MQ Support » amqsputc fails
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.