ibm-messaging / mq-mqi-nodejs Goto Github PK
View Code? Open in Web Editor NEWCalling IBM MQ from Node.js - a JavaScript MQI wrapper
License: Apache License 2.0
Calling IBM MQ from Node.js - a JavaScript MQI wrapper
License: Apache License 2.0
Hi
I have a MQ server running on z/OS. It has a Queue manager, QM1, and two queues Q1 and Q2 (one for each direction). I know that this is working OK.
Then I have a MQ client and ibmmq on another machine: Linux - CentOS.
When a run the sample on the client machine, I get an error (see below):
node amqsget.js Q1 QM1
Sample AMQSGET.JS start
MQ call failed in CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_HOST_NOT_AVAILABLE [2538]
On the client machine I have environment variables:
[morten@localhost samples]$ env | grep MQ
MQSERVER=AAAA.CLCH/TCP/’144.110.110.110’
MQ_ENV_MODE=64
MQ_JAVA_LIB_PATH=/opt/mqm/java/lib64
MQ_JRE_PATH=/opt/mqm/java/jre64/jre
MQ_INSTALLATION_NAME=Installation1
MQ_JAVA_INSTALL_PATH=/opt/mqm/java
MQ_JAVA_DATA_PATH=/var/mqm
MQ_INSTALLATION_PATH=/opt/mqm
MQ_DATA_PATH=/var/mqm
Do you see anything wrong?
Thanks for any help.
Morten
Hi
I have a an MQ9 client set up to work against another machine ( docker) of MQ9 server.
I have verified it works setting up the following
using the .net put sample with host ip 127.0.0.1 and port 1414
and the params
DEV.QUEUE.1 QM1 DEV.ADMIN.SVRCONN
I managed to connect to the queue and send messages
With the node putc sample I have switched the authentication on on line 105
and on line 102 switches the options to
to MQCNO_CLIENT_BINDING
but I keep getting
CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_Q_MGR_NAME_ERROR [2058]
now the queue name is definitely right QM1 as this is the same I use in the MQ explorer.
What I do not see - is where to put the host ( I assume it is localhost by default)
or the connection name.
Any ideas ?
Hi
I'm trying to make a Docker container consisting of MQSeries Client, nodejs, your ibmmq and my own nodejs application, but have not succeeded yet. Has anyone made a Docker container consisting of MQSeries Client and ibmmq? And in a clever way so that the container is as small as possible? I would be very interested to see how the Dockerfile would look like.
Thanks for any help.
Morten
Looked at your setup and did not see the fail if quiesce option being put as a standard.
Should it be added into the default for the js setup?
hi @ibmmqmet I know there is no thread concept in Node.js. But in java I can spawn up for example 30 threads to listen on the queue to increase the performance. So in you package do you have thing like this?
I'm trying to get the amqsconn.js
sample to work with a CCDT file. From the README I can see that I need to set the correct environment variables, but it doesn't seem to have any affect. I'm setting MQCHLLIB
and MQCHLTAB
but cannot get this to work.
Is it possible to provide a very quick snippet on how to use amqsconn.js
with a CCDT file?
Hi
This may be trivial for some people, but it's not clear to me. I'll be happy for any help. It has to do with multiprocessing.
I am writing a web application using node.js and ibmmq. The web application will expose a REST API that clients can call. The typical scenario is:
My question is. In Step 3 I need to do a MQCONN and MQOPEN. Do I leave this open&connected or do I close&disconnect after handling the request? I'm thinking, if I close&disconnect I may destroy for another client? So I would think I should leave it open&connected as long as my web application is running. Is this correct?
Morten
Line 99 in ba41a92
unzip
is not a native command in Windows. I fiddled around with Expand-Archive available in Powershell 5+ (Win10/Server 2016) and got this to work.
unpackCommand='powershell.exe -Command "Expand-Archive -Path ' + file + ' -Destination .\\' + newBaseDir + '\"'
Hi
amqsput.js works, but amqsgeta.js gives me this error:
/home/morten/workspace/ibmmq-test/node_modules/ffi/lib/callback.js:20
throw err
^
AssertionError [ERR_ASSERTION]: Buffer instance must be at least 364 bytes to back this struct type
at new StructType (/home/morten/workspace/ibmmq-test/node_modules/ref-struct/lib/struct.js:84:7)
at Function.get (/home/morten/workspace/ibmmq-test/node_modules/ref-struct/lib/struct.js:158:10)
at Object.get (/home/morten/workspace/ibmmq-test/node_modules/ref/lib/ref.js:452:17)
at Object.deref (/home/morten/workspace/ibmmq-test/node_modules/ref/lib/ref.js:660:18)
at mqiCB (/home/morten/workspace/ibmmq-test/node_modules/ibmmq/lib/mqi.js:1101:18)
at /home/morten/workspace/ibmmq-test/node_modules/ffi/lib/callback.js:66:25
Do you know why I get this error? Thanks for any help.
Morten
Hi
I have installed:
rpm -ivh MQSeriesRuntime-9.0.0-2.x86_64.rpm
rpm -ivh MQSeriesClient-9.0.0-2.x86_64.rpm
and
ibmmq on CentOS.
Now I am trying the sample towards an MQ server running on a different machine.
I have set:
MQSERVER=NITRA.CLCH/TCP/’134.47.105.10’
Then I run the command: node amqsget.js QA.TEST07.FHS_NITRA_RESOURCE_REP M06T
I get the following error:
[morten@localhost samples]$ node amqsget.js QA.TEST07.FHS_NITRA_RESOURCE_REP M06T
/home/morten/Downloads/mq-mqi-nodejs-master/node_modules/bindings/bindings.js:91
throw err
^
Error: Could not locate the bindings file. Tried:
→ /home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/build/binding.node
→ /home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/build/Debug/binding.node
→ /home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/build/Release/binding.node
→ /home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/out/Debug/binding.node
→ /home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/Debug/binding.node
→ /home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/out/Release/binding.node
→ /home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/Release/binding.node
→ /home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/build/default/binding.node
→ /home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/compiled/8.9.1/linux/x64/binding.node
at bindings (/home/morten/Downloads/mq-mqi-nodejs-master/node_modules/bindings/bindings.js:88:9)
at Object. (/home/morten/Downloads/mq-mqi-nodejs-master/node_modules/ref/lib/ref.js:5:47)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object. (/home/morten/Downloads/mq-mqi-nodejs-master/lib/mqi.js:57:11)
Do you know what my problem is?
Morten
Hi,
This is more of a question. Will this support IBM MQ v 8.0.x?
We are trying to deploy to a server where we can't add new directories.
Is there a way to change this path or disable this completely?
Environment:
Sample code:
This happens if there are any errors using the library.
I currently have a CCDT file with 2 channels (same QMGR), one is SSL based and the other is not. What I'm trying to achieve is to first connect to the SSL based one and if any connection failure occurs, switch to the NON-SSL channel.
To connect to the SSL channel I'm using:
cno.CCDTUrl = '/path/to/ccdt';
sco.KeyRepository = '/path/to/key';
sco.CertificateLabel = 'certlabel'
cno.SSLConfig = sco;
I'm not sure where and if I can define the above scenario.
Maybe a stupid question. I have made a Node.js web server which exposes a REST API. Typically it receives a REST call, then sends a message to a MQ queue on another machine, then receives a reply from another MQ queue and responds to the REST call. I was wandering. Do I need to call MQCONN and MQOPEN following by MQCLOSE and MQDISC for very REST call? Or could my web application just call MQCONN and MQOPEN once at start up and then just leave it open for as long as the web application is running?
Thanks
Morten
Thanks for the great library!
I'm wondering if there's an example of how to do message acknowledgement with this using a 9.1.x MQ Client? I'd like to make sure that messages are re-processed if something goes wrong between when they're read off the queue and when the processor is done with them.
Hi
I would like to come back to Issue 17 and the new async Get() implementation. As I said, my put-get program now works fine and I have been able to demonstrate this to my collegues. I’m really happy bout that. Thanks.
My next concern is performance. Will the new async Get() make things slow? What happens when I call Get() quickly one after another?
I’m wondering if this is correct: The first Get() will get the CPU for a little bit and then leave the CPU so that it can process the next ting on the stack. Then after a second the first Get() will get the CPU again. It will poll the MQ queue. If it is able to read something, the callback function started. If not, it will leave the CPU again so that the CPU can start the next thing on the stack, and so forth. Is this correct?
Thanks
Morten
Hi Mark, can you please tell me how can I setup host name, port and channel name? From your sample, I don't see you setup these parameter. By the way, I am a Java guy, I know how to code it in Java to interact with MQ. But we have new requirement and want to build nodejs - mq application. So I am trying to explore how Nodejs work and also your ibmmq module.
Hi,
We are trying to connect IBM MQ server from Linux env.
We are successfully connected to IBM MQ, but now we have getting below error
MQ call failed in CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_CONNECTION_BROKEN [2009] [Pkg ver = 0.5.1]
Using JAVA client, we are able to connect but not from NODE JS.
And one more thing, we are successfully connected to IBM MQ server using NodeJS in Windows platform. Giving error in Linux platform only.
Please provide the inputs on the same.
I'm able to run a sample that will use a CCDT file to successfully connect to a queue, however, is it possible to execute mq.Conn
without defining a qMgr and the qName as the queue manager and queue name are already defined inside the CCDT file?
When I try to remove it or place an empty value it throws an error message.
Line 1035 in ba1866e
jsod
.
While I'm here I just want to say thanks for all the work done so far on bringing this to the community. This is the only issue I've found so far.
There is no sample for amqspub.
I tried modifying amqsput to change the object type to a topic, but to no avail. It says it is successful but i am unable to retrieve the message from the topic.
Getting this error when running. Also, can't find this program: setmqenv
/Users/kevindunetz/Documents/kubernetes/apps/mq-mqi-nodejs/samples/node_modules/ffi/lib/dynamic_library.js:74
throw new Error('Dynamic Linking Error: ' + err)
^
Error: Dynamic Linking Error: dlopen(libmqm_r.dylib, 2): image not found
at new DynamicLibrary (/Users/kevindunetz/Documents/kubernetes/apps/mq-mqi-nodejs/samples/node_modules/ffi/lib/dynamic_library.js:74:11)
at Object.Library (/Users/kevindunetz/Documents/kubernetes/apps/mq-mqi-nodejs/samples/node_modules/ffi/lib/library.js:45:12)
at Object. (/Users/kevindunetz/Documents/kubernetes/apps/mq-mqi-nodejs/samples/node_modules/ibmmq/lib/mqi.js:157:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
Hi
My MQ client and ibmmq are on a Linux CentOS machine. My MQ server is running on another machine (mainframe z/OS). On the MQ server, there is a Queue Manager, M06T and two queues Q1 and Q2 (one for each direction).
Before running the samples, I run this on the client machine (taken from the readme file):
. /opt/mqm/bin/setmqenv -m M06T -k
However this fails. I get:
AMQ7048: The queue manager name is either not valid or not known.
which makes sense to me, because the client machine does not have a queue manager. It's on the server machine.
So really, I don't understand the setmqenv command above.
Thanks for any help.
Morten
I am enjoying the mq-mqi-nodejs library. However, I am having trouble getting a node.js app that runs perfectly fine on my Windows laptop to deploy and run on Bluemix.
cf push test
produces this error ...
[APP/PROC/WEB/0] ERR Error: ENOENT: no such file or directory, open 'libmqm_r.so'
Any help would be appreciated !
Hi
This is a follow-up on the previous issue. (I create a new one, because the previous issue was closed).
I'm struggling a bit. I'll be happy for any advice. My situation is the following: I have a MQ server running on mainframe (z/OS). It has a Queue Manager and two Queues, one for each direction. I also have an MQ client running on mainframe that reads and writes to these queues. This is up and running and working.
Now I want to establish another MQ client at the other end, running on a different machine, Linux - CentOS, and using node.js. I have followed two approaches: 1) ibmmq and 2) mqlight. The problem with 1) is that it is not official and I get execution errors when I run the samples. My last status on is that the command 'node-gyp rebuild' fails when I run it as root. I get:
gyp: binding.gyp not found (cwd: /etc) while trying to load binding.gyp. I am also puzzled that there is a node-gyp both in /bin and in /usr/bin. Do I have two installations?
My latest status on mqlight, is that I am not sure if MQ server running on mainframe (z/OS), supports AMQP. If not, I can rule out mqlight. Do you know?
I will be happy for any advice. Is the way forward for me, ibmmq or mqlight? Or would you recommend REST API.
Thanks for any help.
Morten
Hi. I have looked at the sample code. I would like to try it towards an MQ endpoint on another machine. I see that I can enter queue manager and queue as command line inputs, but where/how do I enter the IP address and port?
Thanks
Morten
Hi
In the readme file it says, before running the sample:
. setmqenv -m -k # to make sure MQ libraries can be found
Do I understand correctly that this command is only relevant if the MQ server is running on the same machine as the MQ client?
In my case, the MQ server is running on a different machine. I suppose this command is not relevant for me? Am I right?
Morten
I am able to successfully yarn add ibmmq
(latest 0.7.1) with node 6 and 8, with the latest node 10.5 I get a compilation error however:
> yarn add ibmmq
(Click to expand)yarn add v1.5.1
(node:6968) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
[3/5] 🚚 Fetching packages...
[4/5] 🔗 Linking dependencies...
[5/5] 📃 Building fresh packages...
[2/3] ⢀ ffi: ^
[-/3] ⢀ waiting...
[-/3] ⢀ waiting...
[-/3] ⢀ waiting...
error An unexpected error occurred: "/Users/simonihmig/Projects/sit-app/core-api/node_modules/ffi: Command failed.
Exit code: 1
Command: sh
Arguments: -c node-gyp rebuild
Directory: /Users/simonihmig/Projects/sit-app/core-api/node_modules/ffi
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn /usr/bin/python
gyp info spawn args [ '/Users/simonihmig/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/simonihmig/Projects/sit-app/core-api/node_modules/ffi/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/simonihmig/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/simonihmig/.node-gyp/10.5.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/simonihmig/.node-gyp/10.5.0',
gyp info spawn args '-Dnode_gyp_dir=/Users/simonihmig/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/simonihmig/.node-gyp/10.5.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/simonihmig/Projects/sit-app/core-api/node_modules/ffi',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CC(target) Release/obj.target/ffi/deps/libffi/src/prep_cif.o
CC(target) Release/obj.target/ffi/deps/libffi/src/types.o
CC(target) Release/obj.target/ffi/deps/libffi/src/raw_api.o
CC(target) Release/obj.target/ffi/deps/libffi/src/java_raw_api.o
CC(target) Release/obj.target/ffi/deps/libffi/src/closures.o
CC(target) Release/obj.target/ffi/deps/libffi/src/x86/ffi.o
CC(target) Release/obj.target/ffi/deps/libffi/src/x86/ffi64.o
CC(target) Release/obj.target/ffi/deps/libffi/src/x86/darwin.o
CC(target) Release/obj.target/ffi/deps/libffi/src/x86/darwin64.o
LIBTOOL-STATIC Release/libffi.a
CXX(target) Release/obj.target/ffi_bindings/src/ffi.o
../src/ffi.cc:58:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(FFI_OK);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:59:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(FFI_BAD_TYPEDEF);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:60:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(FFI_BAD_ABI);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:63:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(FFI_DEFAULT_ABI);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:64:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(FFI_FIRST_ABI);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:65:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(FFI_LAST_ABI);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:81:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(FFI_SYSV);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:83:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(FFI_UNIX64);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:88:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(RTLD_LAZY);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:91:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(RTLD_NOW);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:94:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(RTLD_LOCAL);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:97:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(RTLD_GLOBAL);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:100:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(RTLD_NOLOAD);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:103:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(RTLD_NODELETE);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:106:3: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
SET_ENUM_VALUE(RTLD_FIRST);
^
../src/ffi.cc:38:8: note: expanded from macro 'SET_ENUM_VALUE'
Nan::ForceSet(target, Nan::New<String>(#_value).ToLocalChecked(), \\
^
../../nan/nan_maybe_43_inl.h:130:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
../src/ffi.cc:111:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<String>(\"RTLD_NEXT\").ToLocalChecked(), WrapPointer((char *)RTLD_NEXT), static_cast<PropertyAttribute>(ReadOnly | DontDelete));
~~~~~~ ^
../src/ffi.cc:114:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<String>(\"RTLD_DEFAULT\").ToLocalChecked(), WrapPointer((char *)RTLD_DEFAULT), static_cast<PropertyAttribute>(ReadOnly | DontDelete));
~~~~~~ ^
../src/ffi.cc:117:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<String>(\"RTLD_SELF\").ToLocalChecked(), WrapPointer((char *)RTLD_SELF), static_cast<PropertyAttribute>(ReadOnly|DontDelete));
~~~~~~ ^
../src/ffi.cc:120:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<String>(\"RTLD_MAIN_ONLY\").ToLocalChecked(), WrapPointer((char *)RTLD_MAIN_ONLY), static_cast<PropertyAttribute>(ReadOnly|DontDelete));
~~~~~~ ^
../src/ffi.cc:123:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<String>(\"FFI_ARG_SIZE\").ToLocalChecked(), Nan::New<Uint32>((uint32_t)sizeof(ffi_arg)), static_cast<PropertyAttribute>(ReadOnly|DontDelete));
~~~~~~ ^
../src/ffi.cc:124:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<String>(\"FFI_SARG_SIZE\").ToLocalChecked(), Nan::New<Uint32>((uint32_t)sizeof(ffi_sarg)), static_cast<PropertyAttribute>(ReadOnly | DontDelete));
~~~~~~ ^
../src/ffi.cc:125:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<String>(\"FFI_TYPE_SIZE\").ToLocalChecked(), Nan::New<Uint32>((uint32_t)sizeof(ffi_type)), static_cast<PropertyAttribute>(ReadOnly | DontDelete));
~~~~~~ ^
../src/ffi.cc:126:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<String>(\"FFI_CIF_SIZE\").ToLocalChecked(), Nan::New<Uint32>((uint32_t)sizeof(ffi_cif)), static_cast<PropertyAttribute>(ReadOnly | DontDelete));
~~~~~~ ^
../src/ffi.cc:132:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<String>(\"HAS_OBJC\").ToLocalChecked(), Nan::New<Boolean>(hasObjc), static_cast<PropertyAttribute>(ReadOnly | DontDelete));
~~~~~~ ^
../src/ffi.cc:367:16: warning: 'Call' is deprecated [-Wdeprecated-declarations]
p->callback->Call(1, argv);
^
../../nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
NAN_DEPRECATED inline v8::Local<v8::Value>
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
^
16 warnings and 9 errors generated.
make: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/simonihmig/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.3.0
gyp ERR! command \"/Users/simonihmig/.nvm/versions/node/v10.5.0/bin/node\" \"/Users/simonihmig/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /Users/simonihmig/Projects/sit-app/core-api/node_modules/ffi
gyp ERR! node -v v10.5.0
I've successfully connected to a queue through a non-encrypted channel using a CCDT file and I am able to read messages correctly.
I'm now attempting to use a secure channel via CCDT and wondering if I should just be defining the MQS_KEYSTORE_CONF
env variable and everything should work? Another question, is it possible to use this node module along with JKS?
Hi!
Line 119 in amqsgeta.js decoder.write(buf) seems to give the same result as just buf, is it needed to call decoder.write?
When trying to run the connect sample on centos 6.8 and 6.9, the following error occurs:
Error: Dynamic Linking Error: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /opt/app/node_modules/ibmmq/redist/lib64/../lib64/libmqe_r.so)
at new DynamicLibrary (/opt/app/node_modules/ffi/lib/dynamic_library.js:74:11)
at Object.Library (/opt/app/node_modules/ffi/lib/library.js:45:12)
at loadLib (/opt/app/node_modules/ibmmq/lib/mqi.js:164:18)
at loadLibMulti (/opt/app/node_modules/ibmmq/lib/mqi.js:244:13)
at Object.<anonymous> (/opt/app/node_modules/ibmmq/lib/mqi.js:255:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
I've tried compiling and using glibc 2.14, but then node-gyp fails to compile the ref module.
Here's my Dockerfile:
FROM centos:6.9
RUN curl --silent --location https://rpm.nodesource.com/setup_8.x | bash
RUN yum install -y nodejs
RUN yum update -y
RUN yum groupinstall -y "Development Tools"
RUN yum install -y centos-release-scl
RUN yum install -y devtoolset-4
ENV CC /opt/rh/devtoolset-4/root/usr/bin/gcc
ENV CXX /opt/rh/devtoolset-4/root/usr/bin/g++
ENV FC /opt/rh/devtoolset-4/root/usr/bin/gfortran
COPY package.json /tmp
#install deps
RUN cd /tmp && npm install
#make app dir
RUN mkdir -p /opt/app
#copy into app dir
COPY . /opt/app
#copy node_modules, symlinked modules, package.json and package-lock.json in app dir
RUN cp -a /tmp/* /opt/app
#set work directory
WORKDIR /opt/app
CMD ["npm", "start"]
Any ideas?
We successfully able to connect IBM MQ using java client. Please check below JAVA code.
private void init(String hostName,String port, String qMngr,String channel){
MQEnvironment.hostname = hostName;
MQEnvironment.channel = channel;
MQEnvironment.port = Integer.valueOf(port);
MQEnvironment.properties.put(CMQC.TRANSPORT_PROPERTY, CMQC.TRANSPORT_MQSERIES_CLIENT);
MQQueueManager qManager = null;
try {
qManager = new MQQueueManager(qMngr);
System.out.println("### Connection Successful for host : "+hostName);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
qManager.disconnect();
qManager.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
But when we are trying connect using sample (amqsconn.js) file, we are getting below error.
We have provided appropriate details which is working with JAVA client.
Error:
MQ call failed in CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_Q_MGR_NAME_ERROR [2058] [Pkg ver = 0.4.1]
Please include the following information in your ticket.
if (inspect.name === 'refinspect') {
^
TypeError: Cannot read property 'name' of undefined
at overwriteInspect (/Users/SP/Desktop/Repos/mq-mqi-nodejs/node_modules/ref/lib/ref.js:1455:14)
at Object. (/Users/SP/Desktop/Repos/mq-mqi-nodejs/node_modules/ref/lib/ref.js:1417:32)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
I have installed the ibmmq mocule. I don't have the MQ Client libraries though and that is because there is none for mac os and I suspect that is causing the issue.
How do I get it up and running on mac ?? Any help would be appreciated.
(Please note: I am fairly new to MQ and IBM MQ)
Thanks,
SP
Hi
Maybe a stupid question: I run the sample amqsput.js and then afterwards amqsgeta.js. In the amqsgeta.js file I can see that I enter getCB() twice, first to to display the message and then later to display "No more messages available". Why do I enter getCB twice? The program calls mq.Get(queueHandle,md,gmo,getCB) only once, so I would expect the callback function getCB to be called only once.
Thanks, Morten
@ibmmqmet how can I set SSLCipherSuite("TLS_RSA_WITH_AES_128_CBC_SHA256")?
Hi
I would like to uninstall mq-mqi-nodejs and then try to install it once again. What is the procedure to uninstall mq-mqi-nodejs?
Thanks
Morten
If I put MQC.MQGMO_WAIT instead of MQC.MQGMO_NO_WAIT as in examples, Node freezes
In such places:
gmo.Options = MQC.MQGMO_NO_SYNCPOINT |
MQC.MQGMO_NO_WAIT |
MQC.MQGMO_CONVERT |
MQC.MQGMO_FAIL_IF_QUIESCING;
So I have to request for messages in a loop which makes a delay in receiving from the queue...
Hi,
I am trying to use the module with AWS lambda. I am getting the below run time error.
module initialization error: Error
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at bindings (/var/task/node_modules/bindings/bindings.js:81:44)
at Object. (/var/task/node_modules/ref/lib/ref.js:5:47)
at Module._compile (module.js:570:32)
It is working fine with a standalone nodejs program and windows build tools installed. Please let me know what are dependencies required to make it work with AWS lambda.
Hi
I have made a .js file based on the sample files amqsput.js and amqsgeta.js. When I run this file alone, everything works fine.
Then I integrate this file into a webapplication made from swagger. I make my main function visible to the other files. I.e. I modify my main function from
function putgetmq() { to
exports.putgetmq = function() {
When I now run the application, the line
mq.Get(queueHandle,md,gmo,getCB);
fails. I get the following error:
/home/morten/workspace/nodejs-server-server-generated/nodejs-server-server/node_modules/ffi/lib/callback.js:20
throw err
^
MQError: MQCallback: MQCC = MQCC_FAILED [2] MQRC = MQRC_HCONN_ERROR [2018]
at mqiCB (/home/morten/workspace/nodejs-server-server-generated/nodejs-server-server/node_modules/ibmmq/lib/mqi.js:1153:11)
at /home/morten/workspace/nodejs-server-server-generated/nodejs-server-server/node_modules/ffi/lib/callback.js:66:25
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/morten/.npm/_logs/2017-12-05T07_57_12_367Z-debug.log
Any idea what this is? Thanks for any help.
Morten
I wrote a long time ago a simple JAVA app to monitor MQ 8, it still works but is really slow.
I would rather not add yet another programming language on my nagios system (GOLANG) and was hoping it was possible to use mq-mqi-nodejs to implement a NodeJS version of the MQ-Metrics?
(OR Maybe I just overlooked it in this repo)
4 warnings and 10 errors generated. make: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1 gyp ERR! build error gyp ERR! stack Error:
make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:159:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/diwenlao/Documents/GitHub/nodejs3/node_modules/ffi
gyp ERR! node -v v9.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`
Hi
Maybe a stupid question. Is buffer sizes (for the messages) something I need to worry about, or is it all hidden for me by ibmmq? If not, where do I configure this?
Thanks for any help.
Morten
A general question
I believe it is logical to hold a connection open whilst the application is alive, would it make sense to have a conneciton pool ?
Hi. I need to Interface my node.js Application to IBM MQ, hence I am interested in mq-mqi-nodejs. Are there plans to make it public on npm and if so, when?
Thanks Morten
I'm opening this one, because I'm not sure if you have read my latest comments to #17. I've been working quite a lot on it, but I'm still stuck. And now I'm running out of time. I'm wondering, could there be a bug in ibmmq? I need some help to debug it.
Thanks
Morten
Hi
Maybe my thinking is wrong, but please comment:
From the sample, amqsgeta.js:
function getMessages() {
.. mq.Get(queueHandle,md,gmo,getCB); ..
}
function getCB(err, hObj, gmo,md,buf)
So the callback function has the following parameters: err, hObj, gmo,md,buf
I'm thinking. Would it make sense to add a callback function to the list above? So the list would be: err, hObj, gmo,md,buf,cb ?
In this way getCB could be part of the MQ 'driver' and the callback function, cb, would live in the web application layer (in a different file) and only be concerned with the message itself.
Morten
Hi
When I run amqsget.js, I get a lot of unreadable characters (see below). Any idea what my problem is?
Thanks for any help.
Morten
[morten@localhost samples]$ node amqsget.js QA.TEST07.FHS_NITRA_RESOURCE_REP M06T
Sample AMQSGET.JS start
MQCONN to M06T successful
MQOPEN of QA.TEST07.FHS_NITRA_RESOURCE_REP successful
message <Lo���@��������K�@���������������
�@ONL���nL���n��La���nL�����n���
����La�����nL����
��n��La������nL���
��n��z��@���@�������La�����nL��
���nL��n��z��@���@�������La��nL����n��������La����nL���n��z��@���@�������La�
��nL���n��z��@��@������@����\La�
��nL���n��z��@���@����La�
��nL���n��z���@���@����La�
��nL���n��z���@��@������@����\La�
��nLa��`���nLa���n>
no more messages
MQCLOSE successful
MQDISC successful
Hi
I have installed ibmmq (the new public version !) with the command: npm install ibmmq
I am running on Linux CentOS.
When I run the sample:
node amqsget.js QA.TEST07.FHS_NITRA_RESOURCE_REP M06T
I get the following error:
Error: ENOENT: no such file or directory, open 'libmqm_r.so'
Still the file libmqm_r.so.exist both in /opt/mqm/lib and in /opt/mqm/lib64.
Have you seen this problem before? Any idea what it is? Have I missed a PATH variable?
Thanks
Morten
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.