Skip to content

Instantly share code, notes, and snippets.

@abhirockzz
Created September 13, 2015 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhirockzz/c53117016370f54ad411 to your computer and use it in GitHub Desktop.
Save abhirockzz/c53117016370f54ad411 to your computer and use it in GitHub Desktop.
Protected access to JMSContext
Option 1
---------
@Inject
@JMSConnectionFactory("jms/myConnectionFactory")
@JMSPasswordCredential(password = "secret", userName = "admin")
JMSContext ctx;
----------------------------------------------------------------
Option 2
---------
//inject javax.jms.ConnectionFactory
@Resource("jndi/AppJMSConnFactory")
ConnectionFactory cf;
//use it to create the JMSContext
JMSContext ctx = cf.createContext("admin","secret");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment