• 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 connection factory

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need that inside a MDB to send the received message to multiple queues. So i need to start a new connection to another JMS server.
I read that there is quite an overhead with starting a conection to a jms server, that it implies authentification, and such... looking up the connection factory in the jndi server... The connection is supossed to be multithreaded anyway. So how about we make the connection as static variable, something like in the HomeFactory pattern. Calling start on an already started connection does not get any errors. After finishing up with the message processing, we don;t close the connection and all the beans get to use the same connection? How about that?
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd advise against using static variables in any J2EE application. It's a sure way to undermine scalability and caching in the server.
You could try to create a connection in the ejbCreate method of the MDB and release the connection in the ejbRemove.
 
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic