-
Bug
-
Resolution: Done
-
Major
-
7.1.0.CR4
-
Documentation (Ref Guide, User Guide, etc.)
-
-
-
-
-
Please, document usage of @Resource annotation for injecting JMS resources.
Client (EJB) can inject JMS destinations / connection factories using @Resource annotation.
In @Resouce annotations following parameter can be specified
- lookup
- name
- mappedName
To inject resource, you can specify resource JNDI name in one of this parameters.
Example of queue resource injection
Queue definition
<jms-queue name="OutQueue" entries="jms/queue/OutQueue java:jboss/exported/jms/queue/OutQueue"/>
You can inject this queue by any annotating
{javax.jms.Queue}property by any of following annotations
Injection
@Resource(lookup = "java:jboss/exported/jms/queue/OutQueue") @Resource(lookup = "java:/jms/queue/OutQueue") @Resource(name = "java:jboss/exported/jms/queue/OutQueue") @Resource(name = "java:/jms/queue/OutQueue") @Resource(mappedName = "java:jboss/exported/jms/queue/OutQueue") @Resource(mappedName = "java:/jms/queue/OutQueue")
Injection of connection factory is similar
Default
pooled connection factory can by injected like this
CF injection
@Resource(lookup = "java:/JmsXA") private ConnectionFactory cf;
- clones
-
JBEAP-13818 [CD13][Documentation] Document using of @Resource with JMS resources
- Closed