How to use @Resource annotation to inject Remote JMS Topic & ConnectionFactory

Solution Unverified - Updated -

Issue

  • How can we inject Resources which are deployed on Server-B using @Resource annotation in the applications which are deployed on Server-A.

Example: in EAP6 where "TestTopic" is deployed on Server-B and the below code is being used in Server-A

    @Resource(mappedName = "java:/jboss/exported/jms/topic/TestTopic")
    private Destination topic;

    @Resource(name = "java:/jboss/exported/jms/TestRemoteConnectionFactory")
    private ConnectionFactory connectionFactory;

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.