ファイルに 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に依存関係を追加したいと考えています。この質問は、Web アプリケーションが JBOSS 6.0 で開始されたときに hornet キューが確実に存在するようにするにはどうすればよいですか? に似ています。、しかし、注釈で依存関係を定義したい。これを(いくつかの順列で)試しましたが、正しい方法が見つかりませんでした:
@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")