Author |
Message
|
Inforz |
Posted: Sun Dec 07, 2014 10:24 am Post subject: amqsputc fails |
|
|
 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 |
|
 |
smdavies99 |
Posted: Sun Dec 07, 2014 11:13 am Post subject: |
|
|
 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 |
|
 |
PaulClarke |
Posted: Sun Dec 07, 2014 12:20 pm Post subject: |
|
|
 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 |
|
 |
bruce2359 |
Posted: Sun Dec 07, 2014 1:15 pm Post subject: Re: amqsputc fails |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 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 |
|
 |
exerk |
Posted: Sun Dec 07, 2014 2:23 pm Post subject: Re: amqsputc fails |
|
|
 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 |
|
 |
Inforz |
Posted: Sun Dec 07, 2014 5:56 pm Post subject: |
|
|
 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 |
|
 |
Inforz |
Posted: Sun Dec 07, 2014 6:19 pm Post subject: |
|
|
 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 |
|
 |
Inforz |
Posted: Sun Dec 07, 2014 6:21 pm Post subject: Re: amqsputc fails |
|
|
 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 |
|
 |
Inforz |
Posted: Sun Dec 07, 2014 6:22 pm Post subject: Re: amqsputc fails |
|
|
 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 |
|
 |
bruce2359 |
Posted: Sun Dec 07, 2014 7:33 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 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 |
|
 |
Inforz |
Posted: Sun Dec 07, 2014 9:09 pm Post subject: |
|
|
 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 |
|
 |
bruce2359 |
Posted: Sun Dec 07, 2014 10:06 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 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 |
|
 |
bruce2359 |
Posted: Sun Dec 07, 2014 10:15 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 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 |
|
 |
fjb_saper |
Posted: Sun Dec 07, 2014 10:18 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
Inforz |
Posted: Sun Dec 07, 2014 10:41 pm Post subject: |
|
|
 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 |
|
 |
|