• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JMS

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am new to JMS .
I am using wsad5.1 version.
I written one simple jms programming of point-to-point.
I am able to sending message queue successfully.
What my question is where can i find out that message will be stored in the queue.

this is the code i am attaching


Context ctx = new InitialContext();
QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("java:comp/env/jms/QueueConnectionFactory");

Queue queue = (Queue) ctx.lookup("java:comp/env/jms/Queue");
QueueConnection conn = factory.createQueueConnection();
QueueSession session = conn.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(queue);
conn.start();
TextMessage msg = session.createTextMessage(XML);
int DDM=TextMessage.DEFAULT_DELIVERY_MODE;
int DP=TextMessage.DEFAULT_PRIORITY;
long DTTL=TextMessage.DEFAULT_TIME_TO_LIVE;
int deliveryMode=sender.getDeliveryMode();
int priyarityMode=sender.getPriority();
sender.send(msg,deliveryMode,priyarityMode,5 * 60 * 1000);
sender.close();
session.close();
conn.close();
} catch (Exception e) {
}
return XML;
}

mdb
************

public void onMessage(javax.jms.Message msg) {
System.out.println("Enter the onMessage()");
TextMessage tm = (TextMessage) msg;
try {
String text = tm.getText();
}
catch(JMSException ex) {
ex.printStackTrace();
}
}
 
Pay attention! Tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic