我在文件中有一个 JMS-Queue 的简单定义my-hornetq-jms.xml
:
<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
<queue name="my.test.queue">
<entry name="/queue/myTest"/>
</queue>
</configuration>
队列已正确激活,现在我想在我的@Stateless
Bean 中添加一个依赖项。这个问题类似于我的 webapp 在 JBOSS 6.0 中启动时如何确保大黄蜂队列存在?,但我想用注释定义依赖关系。我试过这个(在几个排列中),但没有找到正确的方法:
@Depends(value="org.hornetq:module=JMS,type=Queue,name=my.test.queue")
我总是收到这样的错误:
Dependency "<UNKNOWN jboss.j2ee:jar=my.war,name=MyBean,service=EJB3>"
(should be in state "Installed", but is actually in state "** UNRESOLVED Demands
'org.hornetq:module=JMS,name=my.test.queue,type=Queue' **")
顺便说一句:在 JBoss-5 中,我这样定义它:@Depends(value = "jboss.messaging.destination:service=Queue,name=my.test.queue")