开发者

JBoss HornetQ: Set consumer-window-size for slow consumer

开发者 https://www.devze.com 2023-03-27 20:54 出处:网络
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 ch开发者_如何学JAVAapte

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 ch开发者_如何学JAVAapter 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消