Open gowrimech32 opened 1 year ago
RE:
cno.Options |= MQC.MQCNO_CLIENT_BINDING;
Is your application running on the same machine as the queue manager?
No.... I am trying to connect queue manager which is running in different server.
That code, as you have already proven, should connect successfully. Which implies that your application is either not using the same code (add a check by logging something in that function that makes it clear that function is being invoked) or it is using it in a different way.
Your function validate
takes in 3 arguments, but it is only using one - output
.
Is your application expecting validate
to do something with input
or options
?
I have already checked by adding loggers. It is invoking the function properly. I was getting below error. Then i solved it by copying the files from '/opt/mqm/lib64' to my application directory.
ENOENT: no such file or directory, open libmqm_r.so
After adding few more logger, i could see it is failing at below line.
libmqm.MQCONNX.async(mqqMgrName,mqCno.ref(), mqHConn,mqCc,mqRc, function (error,resp)
That seems to be your platform's equivalent to a LD_LIBRARY_PATH
related issue.
From the README.md
For Windows and Linux x64, the npm installation process tries to access the Redistributable Client packages and unpack them automatically.
...
If you do not want this automatic installation of the MQ runtime, then set the environment variable
MQIJS_NOREDIST
to any value before running npm install. The MQ libraries are then be found at runtime using mechanisms such as searchingLD_LIBRARY_PATH
(Linux) orPATH
(Windows).
By inference this automatic fetch of the redistributable client isn't performed on other platforms.
I could see same result after setting LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/mqm/lib64
Check that the setting was inherited by the application by logging the value in your code.
eg.
debug_info("LD_LIBRARY_PATH : ", process.env.LD_LIBRARY_PATH);
I am calling the below node js script from our application.
The application user has access to Queue manager. If i run this method as a standalone script, it works fine. but if i run from application, then getting below error message.
CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_CONNECTION_BROKEN [2009];MQCC_FAILED:2009;MQRC_CONNECTION_BROKEN