![](/img/trans.png)
[英]GetDone in ibmmq (Node.js) doesn't stop listener of the queue
[英]ibmmq node client can't find MQ C Library, fails consistently
我正在嘗試創建一個對服務器和 MQ 容器進行 docker 化的節點應用程序,並使用 ibmmq 節點客戶端與所述容器進行交互。 我遇到了一個問題,我無法讓我的服務器運行,因為找不到 MQ C 庫。 有問題的具體錯誤:
Cannot find MQ C library.
System appears to be: linux[x64]
Has the MQ C client been installed?
Have you run setmqenv?
Error: ENOENT: no such file or directory, open '/opt/mqm/lib/libmqm_r.so'
at Object.openSync (fs.js:462:3)
at readFileSync (fs.js:364:35)
at new DynamicLibrary (/server/node_modules/ffi-napi/lib/dynamic_library.js:68:23)
at Object.Library (/server/node_modules/ffi-napi/lib/library.js:47:10)
at loadLib (/server/node_modules/ibmmq/lib/mqi.js:290:18)
at loadLibMulti (/server/node_modules/ibmmq/lib/mqi.js:417:13)
at Object.<anonymous> (/server/node_modules/ibmmq/lib/mqi.js:436:1)
at Module.<anonymous> (internal/modules/cjs/loader.js:999:30)
at Module._compile (/server/node_modules/source-map-support/source-map-support.js:568:25)
at internal/modules/cjs/loader.js:1027:10
[ERROR] 07:40:21 Error: ENOENT: no such file or directory, open '/opt/mqm/lib/libmqm_r.so'
當我 go 檢查 /opt/... 時,沒有文件夾 mqm。 我不太確定何時會在此過程中創建它。
這是我的 docker 文件:
FROM node:12
# Non-development values will be provided by Drone when
# deploying to staging or production
ARG ENV="development"
WORKDIR /server
COPY package.json .
COPY yarn.lock .
RUN yarn install --production=false
COPY . .
# In non-dev environments, we need to build executable code
# during image build time so that we're not doing it at
# container startup (which would cause significant down-time)
RUN if [ $ENV = "staging" ] || [ $ENV = "production" ]; \
then yarn build; \
fi
CMD ["yarn", "serve"]
觸發問題的具體代碼:
import mq from 'ibmmq'
const MQC = mq.MQC
我嘗試了一些方法,包括不讓 c 庫構建,但沒有任何效果。 任何幫助將不勝感激,在此先感謝!
請參閱https://github.com/ibm-messaging/mq-mqi-nodejs/tree/master/samples以了解使用npm install
的工作 Dockerfile 示例。
linux x64 的安裝后腳本通常會引入 MQ Redist C 客戶端 package。如果安裝后由於某種原因未運行,或者無法下載 package,則必須手動安裝 MQ C 客戶端。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.