activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Nguyen <>
Subject Best practices with JMS
Date Fri, 04 Mar 2011 17:07:05 GMT
I am using ActiveMQ and I am reading Java Message Service document which 
specifies the JMS JSR. However I cant find anywhere what are the best practices 
for Connection length. From the JMS JSR I understand that:

Connection is Heavy weight object as JMS JSR suggests. So its ok to create it at 
start of the application and release it just before application closes

Going further the Session is supposed to be lightweight object so there should 
be no problem to create it more often. Butas indicated here: there 
is James.Strachan suggests to use 1 consumer for whole application to aovid 
receivenowait problems.

My questions are (assuming I want to avoid requestNoWait problems and i dont 
want to call receive(1000)):

   1. How long should connection be opened (after calling start()) and are there
      any problems with having it opened for a long long time?
   2. How long should one Session be opened? (this relates to MessageConsumer
      because I assume the consumer needs to have session opened).

Filip Nguyen

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message