Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-14824

[7.1][Documentation] Document using of @Resource with JMS resources

    XMLWordPrintable

Details

    Description

      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

      {activemq-ra}

      pooled connection factory can by injected like this

      CF injection
          @Resource(lookup = "java:/JmsXA")
          private ConnectionFactory cf;
      

      Attachments

        Issue Links

          Activity

            People

              snelluli@redhat.com Sreelatha Nelluli
              snelluli@redhat.com Sreelatha Nelluli
              Martin Styk Martin Styk (Inactive)
              Martin Styk Martin Styk (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: