You should (theoretically) be able to share the same ActiveMQ-CPP
session between multiple threads, but we did create the CMS API as a
direct port of JMS.  With that said, I'm not sure how thoroughly the
ActiveMQ-CPP session class was tested with multiple threads.  You can
always give it a try and raise a JIRA issue if you run into problems. 

Regards,
Nate

> -----Original Message-----
> From: fredrick255 [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2008 11:39 AM
> To: users@activemq.apache.org
> Subject: Re: JMS Threading Restriction
> 
> 
> Is this also the case in CMS (activemq-cpp)?
> 
> 
> 
> rajdavies wrote:
> >
> >
> > On 14 Jun 2008, at 01:50, Joshua Smith wrote:
> >
> >> All-
> >>
> >> I'm reading a number of references on JMS written some time between
> >> 2001 and
> >> now. The challenge that comes with that is knowing which things are
> >> still
> >> true today and which things were describing the state of affairs at
> >> that
> >> time. I found the following paragraph in the O'reilly Java Message
> >> Service
> >> (First Edition) book written in 2001 on p. 32. Can anyone confirm
> >> that this
> >> is still an accurate description of JMS?
> >>
> >>
> >> "The Chat application ((which is what they use for their JMS
example
> >> in the
> >> book)) uses a separate session for the publisher and subscriber,
> >> pubSession
> >> and subSession, respectively. This is due to a threading
restriction
> >> imposed
> >> by JMS. ***According to the JMS specification, a session may not be
> >> operated
> >> on my more than one thread at a time.*** In our example, two
threads
> >> of
> >> control are active: the default main thread of the Chat application
> >> and the
> >> thread that invokes the onMessage() handler. The thread that
invokes
> >> the
> >> onMessage() handler is owned by the JMS provider. Since the
> >> invocation of
> >> the onMessage() handler is asynchronous, it could be called while
> >> the main
> >> thread is publishing a message in the writeMessage() method. If
both
> >> the
> >> publisher and subscriber had been created by the same session, the
two
> >> threads could operate on these methods at the same time; in effect,
> >> they
> >> could operate on the same TopicSession - a condition that is
> >> prohibited."
> >> (emphasis mine)
> >>
> >>
> >> Thanks,
> >> Joshua Smith
> >
> >
> > Hi Joshua,
> >
> > I used to have a copy of that book somewhere!
> > Yep - its still an accurate description of JMS
> >
> >
> >
> >
> > cheers,
> >
> > Rob
> >
> > http://open.iona.com/products/enterprise-activemq
> > http://rajdavies.blogspot.com/
> >
> >
> >
> >
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/JMS-Threading-
> Restriction-tp17834428p18897096.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.


This message is intended only for the addressee and may contain information 
that is confidential or privileged. Unauthorized use is strictly prohibited and 
may be unlawful. If you are not the intended recipient, or the person 
responsible for delivering to the intended recipient, you should not read, 
copy, disclose or otherwise use this message. If you have received this email 
in error, please delete and advise immediately.

Reply via email to