【问题标题】:JBoss EAP 6.2 any-address and Netty for remote JMS MDBs用于远程 JMS MDB 的 JBoss EAP 6.2 任意地址和 Netty
【发布时间】:2014-08-24 20:10:14
【问题描述】:

我将JBoss EAP 6.2(嵌入HornetQ 2.3.12.Final)作为一个独立消息服务器运行,它将托管JMS 队列和主题。

会有其他 JBoss 服务器远程连接到 Messaging Server 的队列和主题。

使用这个 Stackoverflow 答案:Binding JBoss AS 7 to all interfaces

我对我的standalone-full.xml 配置进行了以下更改:

<interfaces>
    ...
    <interface name="public">     
<!--<inet-address value="${jboss.bind.address:127.0.0.1}"/>-->
        <any-address/>
    </interface>
</interfaces>

进行此更改后,我可以通过端口 4447 (JBoss Remoting) 成功连接其他 JBoss 服务器并编写 JMS 客户端代码(ConnectionFactory、Connection、MessageProducer 等)。

JBoss 日志有以下内容,让人放心:

[org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: 
Listening on 0.0.0.0:4447

但是,我无法通过远程 MDB 进行连接。 :-( 我需要弄清楚这一点,因为我们做的是 MDB,而不是 JMS 客户端代码。

我查看了我的 JBoss 日志,看到以下 错误

HQ121005: Invalid "host" value "0.0.0.0" detected for "netty" connector. 
Switching to "ptenn-fc20.arbfile.org". If this new address is incorrect please 
manually configure the connector to use the proper one.

我查看了&lt;subsystem xmlns="urn:jboss:domain:messaging:1.4"&gt;&lt;hornetq-server&gt; ... 部分,没有看到任何关于如何为“netty”连接器指定不同地址的信息。

Netty 似乎确实使用了我指定的公共接口,我很困惑为什么 JBoss Remoting(在端口 4447 上)可以很好地在 0.0.0.0 上监听,但 Netty(在端口 5445 上)却不是。

如果有人有任何想法、见解或建议,我将不胜感激。 :-)

谢谢,

菲利普

【问题讨论】:

    标签: java jboss jms jboss7.x netty


    【解决方案1】:

    菲利普,

    主机是通过standalone-full-ha.xml的interfaces元素指定的。

    然后,您可以在同一配置文件的 socket-bindings 元素中引用该接口。

    例如下面的示例将 JMS 绑定到特定的 IP 地址,不再是 0.0.0.0...

    <interfaces>
        <interface name="management">
            <!--<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>-->
            <inet-address value="0.0.0.0"/>
        </interface>
        <interface name="public">
            <inet-address value="0.0.0.0"/>
            <!--just an FYI that we can use the following syntax too-->
            <!--<any-address/>-->
        </interface>
        <interface name="jms">  <-- HERE
            <inet-address value="${jboss.bind.address}"/>
        </interface>
        <!-- TODO - only show this if the jacorb subsystem is added  -->
        <interface name="unsecure">
            <!--
              ~  Used for IIOP sockets in the standard configuration.
              ~                  To secure JacORB you need to setup SSL 
              -->
            <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
        </interface>
    </interfaces>
    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        .
        .
        .
    
        <!--JMS-->
        <socket-binding name="messaging" port="5445" interface="jms"/>  <-- HERE
        .
        .
        .
    </socket-binding-group>
    

    罗伯

    【讨论】:

      猜你喜欢
      • 2014-09-13
      • 2015-12-21
      • 2023-03-20
      • 2017-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多