[jboss-user] [Messaging, JMS & JBossMQ] - Re: JMS communication between Tomcat app and JBOSS AS 4.2.2`
tpawankumar
do-not-reply at jboss.com
Thu Feb 14 23:20:55 EST 2008
Hi,
I have recieved messages on my tomcat application.Following is the code
Properties props = new Properties();
| props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
| props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
| props.setProperty("java.naming.provider.url", "jnp://localhost:1099");
|
| Context context = new InitialContext(props);
|
| TopicConnectionFactory tcf = (TopicConnectionFactory) context.lookup("TopicConnectionFactory");;
| conn = tcf.createTopicConnection();
| topic = (Topic) context.lookup("topic/testTopic");
|
| session = conn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);
| conn.start();
|
| TopicSubscriber recv = session.createSubscriber(topic);
| recv.setMessageListener(this);
For listening messages i have placed the following jars in commom/lib
jbossall-client.jar and jnp-client.jar.
My application is able to recieve messages from Jboss JMS.
Hope this helps you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129552#4129552
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129552
More information about the jboss-user
mailing list