File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Best practices for resource handling in JMS standalone client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Best practices for resource handling in JMS standalone client" Watch "Best practices for resource handling in JMS standalone client" New topic
Author

Best practices for resource handling in JMS standalone client

Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Hello folks,

I'm working on a simple Java SE client which acts as a JMS message producer. The application isn't very complicated but I have doubts regarding JMS resource handling in a standalone application.

Of course I want to use or re-use resources like Connections as efficient as possible. On the other hand the application should be as robust as possible regarding network or broker failures.

What are your best practices? For example should I reuse a single JMS Connection as long as possible? Or is it more robuts to create a new Connection each time the client wants to send a message? What are good ways to deal with network or broker failures? Do you think it would be a good idea to use an embeddable broker (like ActiveMQ) which is used for persistent message queueing inside the application itself?

This won't be an application with high throughput. As it will be running as a daemon it's more important to create an application that prevents resource bottlenecks and can deal with situations where the broker (or application server) is gone or the network connection between the application and the broker is down.

Thanks in advance!

Marco
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Best practices for resource handling in JMS standalone client