2011-08-11 33 views
7

我想將​​設置爲0。這似乎是另一個問題(JMS queue with multiple consumers)的答案,並在第17.1.1章中的article中進行了描述。我使用JNDI檢索連接工廠。我hornetq-jms.xml看起來是這樣的:JBoss HornetQ:爲消費緩慢的用戶設置消費者窗口大小

<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/>是從上面的鏈接複製&粘貼,但我得到了錯誤:

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相關,因爲在其他環境這似乎工作:force order of messages with HornetQ

回答

9

之前您將網狀連接器,你需要看看你已經在你的hornetq-configuration.xml文件中註冊的連接器

從你HornetQ的配置,你會看到這樣的事情:

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

你在這裏你連接工廠定義相匹配的連接器。

欲瞭解更多信息,請閱讀HornetQ有關接受器和連接器的文檔。

+0

感謝您指出這一點! – Thor