This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JMS in JBoss" Watch "JMS in JBoss" New topic
Author

JMS in JBoss

srinivas gopalan
Greenhorn

Joined: Feb 19, 2004
Posts: 4
Hi all,
I am facing problem in JMS configuration in JBoss. I am using the default ConnectionFactory java:/XAConnectionFactory.
My code looks like this:
Properties h = null;
try
{
h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
h.put(Context.PROVIDER_URL, "http://localhost:8010/invoker/JNDIFactory");
}
catch (Exception ne) {
System.out.println("Error in Service Controller=" + ne.toString());
}
InitialContext iniCtx = new InitialContext(h);
Object tmp = iniCtx.lookup("java:/XAConnectionFactory");
The above line is giving errors

TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
conn = tcf.createTopicConnection("jduke", "theduke");
conn.setClientID("OtherSubscriptions");
topic = (Topic) iniCtx.lookup("topic/testTopic");
session = conn.createTopicSession(false,
TopicSession.AUTO_ACKNOWLEDGE);
conn.start();
what should I do to send and receive a message in JBoss?
thanks in advance
srinivas
anandraj tadkal
Ranch Hand

Joined: Feb 22, 2011
Posts: 98

Hi Srinivas,

For a JMS Setup, we would require a JMS Producer program which creates messages and posts onto the JMS Queue/ Topic which it is bound to.

There should be one JMSConsumer program which can be your stand alone client or a MDB which listens to the JMS Queue/ Topic to consume the messages.

Follow the below link for a general demonstration of JMS feature in JBoss.

http://weblogic-wonders.com/weblogic/2010/07/06/jboss-jms-queue-configuration/

For more JBoss - JMS stuff, you can refer the below link.

http://weblogic-wonders.com/weblogic/jboss/

Cheers,
Anandraj
http://weblogic-wonders.com

Regards,
Anandraj
http://weblogic-wonders.com
Follow us on facebook:
https://www.facebook.com/weblogicwonders
 
Consider Paul's rocket mass heater.
 
subject: JMS in JBoss
 
Similar Threads
does JBoss ship with a predefined TopicConnectionFactory?
Jboss Messaging
trouble accessing jms queue in jboss/tomcat axis
JMS Client Communication behind NAT
Servlet JNDI lookup fails for Connection Factory on Jboss