我想设置<consumer-window-size/>
为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>
该部分<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 相关,因为在其他环境中这似乎有效:使用 HornetQ 强制消息顺序