JBoss HornetQ:为慢速消费者设置消费者窗口大小 [英] JBoss HornetQ: Set consumer-window-size for slow consumer

查看:121
本文介绍了JBoss HornetQ:为慢速消费者设置消费者窗口大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将<consumer-window-size/>设置为0.这似乎是另一个问题的答案(具有多个使用者的JMS队列),并在此

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>

<connection-factory/>部分是上面链接中的复制粘贴,但出现错误:

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.]

这可能与JBoss-6有关,因为它在其他环境中似乎可行:用HornetQ强制消息顺序

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

推荐答案

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

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

在hornetq配置中,您将看到类似以下内容的

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.

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

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

这篇关于JBoss HornetQ:为慢速消费者设置消费者窗口大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆