File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes JMS in Jboss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JMS in Jboss" Watch "JMS in Jboss" New topic
Author

JMS in Jboss

Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 385
I am trying to creating simple JMS application.

Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming rg.jnp.interfaces");
props.setProperty("java.naming.provider.url", "localhost:1099");
Context _init = new InitialContext(props);

ConnectionFactory _cf = (ConnectionFactory) _init.lookup("QueueConnectionFactory");
Destination _dest = (Destination)_init.lookup("");
_init.close();

Connection _connection = _cf.createConnection();
Session _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer _sender = _session.createProducer(_dest);
TextMessage _text = _session.createTextMessage("Hello JMS!!");
_sender.send(_text);

_connection.close();


What JNDI name should be given for Destination?

Shashank


SCJP 1.4, SCWCD 1.4, SCBCD 1.5
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9329
    
110

If its a queue named testQueue then the jndi name by default will be queue\testQueue


[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMS in Jboss
 
Similar Threads
JBOSS MDB MessageID coming as Null
JMS: lookup
JBOSS5.0 EJB3 lookup issue
ActiveMQ dynamic queues
Had an issue while accessing JMS remotely