aspose file tools*
The moose likes Servlets and the fly likes JMS & WL 10.3 - Sender Servlet for sending  asynchronously to a Queue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JMS & WL 10.3 - Sender Servlet for sending  asynchronously to a Queue " Watch "JMS & WL 10.3 - Sender Servlet for sending  asynchronously to a Queue " New topic
Author

JMS & WL 10.3 - Sender Servlet for sending asynchronously to a Queue

Marcus Sainz
Greenhorn

Joined: Dec 03, 2008
Posts: 3
Hi there:

I'm trying to send messages from a Servlet to a queue asynchronously. I've been reading a lot and I still don't have a clear idea about if this is possible or not.

I've created a Connection Factory with One-way message sending enabled for both topics and queues, and I use this code on the sender.


code:
--------------------------------------------------------------------------------

Context ctx = new InitialContext();
qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
qcon = qconFactory.createQueueConnection();
queue = (Queue) ctx.lookup(QUEUE);
qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
qsender = qsession.createSender(queue);
qcon.start();qsender.send(msg,DeliveryMode.NON_PERSISTENT,4,1000);
qsender.close();qsession.close();qcon.close();

--------------------------------------------------------------------------------



This code works nice but I need to know how to make this sendings asynchronously if it is possible, I don't want to wait to the queues acknowledge.

Thanks!
[ December 03, 2008: Message edited by: bisala ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61653
    
  67

"bisala", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Marcus Sainz
Greenhorn

Joined: Dec 03, 2008
Posts: 3
It's done the update Bear Bibeault. Hope it takes effect.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMS & WL 10.3 - Sender Servlet for sending asynchronously to a Queue