Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 958
Thor Avatar asked Aug 11 '11 06:08

Thor


1 Answers

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.

like image 59
Clebert Suconic Avatar answered Nov 14 '22 21:11

Clebert Suconic