wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 1280

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
 
Consider Paul's rocket mass heater.
 
subject: Best practices for resource handling in JMS standalone client
 
Similar Threads
Issue with concurrency and transaction handling in JEE
RMI v/s JMS
000-341 sample test questions
is it good practice to initialize a ConnectionFactory in a servlet and save in JNDI?
B&S: How do you handle the Exit in network mode?