Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JMS in JBoss

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 98
Oracle Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
I want my playground back. Here, I'll give you this tiny ad for it:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic