IBM MQ和Kafka连接器问题(提供的主机名无效)

时间:2018-04-26 13:24:39

标签: ubuntu apache-kafka jms ibm-mq

我一直在尝试在我的Ubuntu上将IBM MQ连接到Kafka。我想从MQ获取消息到Kafka。我正在尝试使用连接器Link。我按照所有步骤进行了操作,但我仍然遇到以下错误:

  提供的

主机名无效。

  

JMSCMQ0001:IBM MQ调用失败,包含compcode' 2' (' MQCC_FAILED')原因' 2538' (' MQRC_HOST_NOT_AVAILABLE&#39)。

我尝试了一切,但似乎没有任何效果。如果有人遇到同样的问题,请告诉我。

我的配置包括以下行: -

# A list of one or more host(port) entries for connecting to the queue manager. Entries are separated with a comma - required
mq.connection.name.list=localhost:1414

2 个答案:

答案 0 :(得分:2)

将安德鲁·斯科菲尔德的评论转变成一个答案,以免它在迷雾中迷失。

您的配置文件包含以下内容: -

phrase(cond(_, X), [int(2), sep(<), int(1), sep(-),id(N)]).
   Call:  (10)  ? cond(_G2313, _G2314, [int(2), sep(<), int(1), sep(-), id(_G2336)], [])creep
   Call:  (11)  ? expr(_L254, _G2482, [int(2), sep(<), int(1), sep(-), id(_G2336)], _L235)creep
   Exit:  (11)  ? expr(_L254, int(2), [int(2), sep(<), int(1), sep(-), id(_G2336)], [sep(<), int(1), sep(-), id(_G2336)])creep
   Call:  (11)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(>)|_G2488]creep
   Fail:  (11)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(>)|_G2488]creep
   Redo:  (11)  ? expr(_L254, _G2482, [int(2), sep(<), int(1), sep(-), id(_G2336)], _L235)creep
   Call:  (12)  ? expr(_L279, _G2485, [int(2), sep(<), int(1), sep(-), id(_G2336)], _L260)creep
   Exit:  (12)  ? expr(_L279, int(2), [int(2), sep(<), int(1), sep(-), id(_G2336)], [sep(<), int(1), sep(-), id(_G2336)])creep
   Call:  (12)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(+)|_G2491]creep
   Fail:  (12)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(+)|_G2491]creep
   Redo:  (12)  ? expr(_L279, _G2485, [int(2), sep(<), int(1), sep(-), id(_G2336)], _L260)creep
   Call:  (13)  ? expr(_L304, _G2488, [int(2), sep(<), int(1), sep(-), id(_G2336)], _L285)creep
   Exit:  (13)  ? expr(_L304, int(2), [int(2), sep(<), int(1), sep(-), id(_G2336)], [sep(<), int(1), sep(-), id(_G2336)])creep
   Call:  (13)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(+)|_G2494]creep
   Fail:  (13)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(+)|_G2494]creep
   Redo:  (13)  ? expr(_L304, _G2488, [int(2), sep(<), int(1), sep(-), id(_G2336)], _L285)creep
   Call:  (14)  ? expr(_L329, _G2491, [int(2), sep(<), int(1), sep(-), id(_G2336)], _L310)creep
   Exit:  (14)  ? expr(_L329, int(2), [int(2), sep(<), int(1), sep(-), id(_G2336)], [sep(<), int(1), sep(-), id(_G2336)])creep
   Call:  (14)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(+)|_G2497]creep
   Fail:  (14)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(+)|_G2497]creep
   Redo:  (14)  ? expr(_L329, _G2491, [int(2), sep(<), int(1), sep(-), id(_G2336)], _L310)creep
   Call:  (15)  ? expr(_L354, _G2494, [int(2), sep(<), int(1), sep(-), id(_G2336)], _L335)creep
   Exit:  (15)  ? expr(_L354, int(2), [int(2), sep(<), int(1), sep(-), id(_G2336)], [sep(<), int(1), sep(-), id(_G2336)])creep
   Call:  (15)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(+)|_G2500]creep
   Fail:  (15)  ? [sep(<), int(1), sep(-), id(_G2336)]=[sep(+)|_G2500]
   ...

IBM MQ不使用行业标准mq.connection.name.list=localhost:1414 语法。它使用host:port。不幸的是,指令中存在(现在已修复)错误。

请改用以下语法: -

host(port)

答案 1 :(得分:0)

  
      提供的
  1. 主机名无效。
  2.   
  3. JMSCMQ0001:IBM MQ调用失败,compcode为'2'('MQCC_FAILED'),原因为'2538'('MQRC_HOST_NOT_AVAILABLE')。
  4.   

错误消息非常清楚,主机名/连接名称无效。

您提供的链接表明“mq-source.properties”文件的连接信息指定为:

mq.connection.name.list=localhost(1414)

在这种情况下,作者在与MQ客户端应用程序相同的服务器上测试队列管理器,即localhost,它与127.0.0.1相同。每个队列管理器必须具有唯一的端口#。 1414是默认值。

因此,如果您的队列管理器在远程主机上运行,​​即10.10.10.10并使用端口#1415,则mq.connection.name.list值将为:

mq.connection.name.list=10.10.10.10(1415)

那么,你在哪里运行队列管理器和端口#是否正在使用?