JBoss HornetQ:为慢速消费者设置消费者窗口大小

发布于 2024-11-29 03:53:27 字数 1571 浏览 3 评论 0原文

我想将 设置为 0。这似乎是另一个问题的答案( 具有多个消费者的 JMS 队列 ),并在此 文章章节17.1.1。我使用 JNDI 检索连接工厂。我的 hornetq-jms.xml 看起来像这样:

<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

  <connection-factory name="ConnectionFactory">
    <connectors>
      <connector-ref connector-name="netty-connector"/>
    </connectors>
    <entries>
      <entry name="ConnectionFactory"/>       
    </entries>
    <consumer-window-size>0</consumer-window-size>
  </connection-factory>

  <queue name="my.qeue">  
    <entry name="/queue/test"/>  
  </queue>   
</configuration>

部分是从上面的链接复制并粘贴的,但我收到错误:

DEPLOYMENTS IN ERROR:
Deployment "org.hornetq:module=JMS,name="ConnectionFactory",
  type=ConnectionFactory" is in error due to the following reason(s):
  HornetQException[errorCode=104 message=There is no connector with
  name 'netty-connector' deployed.]

This可能与 JBoss-6 相关,因为在其他环境中这似乎有效: force order of与 HornetQ 的消息

I want to set the <consumer-window-size/> to 0. This seems to be the answer of another question ( JMS queue with multiple consumers ), and is described in this article in chapter 17.1.1 . I retrieve the connection factory using JNDI. My hornetq-jms.xml looks like this:

<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

  <connection-factory name="ConnectionFactory">
    <connectors>
      <connector-ref connector-name="netty-connector"/>
    </connectors>
    <entries>
      <entry name="ConnectionFactory"/>       
    </entries>
    <consumer-window-size>0</consumer-window-size>
  </connection-factory>

  <queue name="my.qeue">  
    <entry name="/queue/test"/>  
  </queue>   
</configuration>

The section <connection-factory/> is copy&paste from the link above, but I got the error:

DEPLOYMENTS IN ERROR:
Deployment "org.hornetq:module=JMS,name="ConnectionFactory",
  type=ConnectionFactory" is in error due to the following reason(s):
  HornetQException[errorCode=104 message=There is no connector with
  name 'netty-connector' deployed.]

This may be JBoss-6 related, because in other environments this seems to work: force order of messages with HornetQ

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

素年丶 2024-12-06 03:53:27

在放置 netty-connector 之前,您需要查看在 hornetq-configuration.xml 中注册的连接器。

从您的 hornetq-configuration 中,您将看到如下内容:

<connectors>
        <connector name="netty">
                <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                <param key="host" value="${jboss.bind.address:localhost}" />
                <param key="port" value="${hornetq.remoting.netty.port:5445}" />
        </connector>

        <connector name="in-vm">
                <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
                <param key="server-id" value="${hornetq.server-id:0}" />
        </connector>

</connectors>

You will have match the Connector here at your connection-factoryDe​​finition 。

有关更多信息,请阅读 HornetQ 有关接受器和连接器的文档。

Before you place netty-connector, you need to look at the connectors your have registered at your hornetq-configuration.xml

From your hornetq-configuration, you will see something like this:

<connectors>
        <connector name="netty">
                <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                <param key="host" value="${jboss.bind.address:localhost}" />
                <param key="port" value="${hornetq.remoting.netty.port:5445}" />
        </connector>

        <connector name="in-vm">
                <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
                <param key="server-id" value="${hornetq.server-id:0}" />
        </connector>

</connectors>

You will have match the connector here at your connection-factory definition.

For more information read the HornetQ's documentation about acceptors and connectors.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文