activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Pechorin <>
Subject ActiveMQ-CPP - why ResourceLifecycleManager is not synchronized?
Date Fri, 19 Feb 2010 14:39:02 GMT


We use ActiveMQ C++ 3.1.0 client in a multi-threaded application. We use
activemq::cmsutil::SessionPool and activemq::cmsutil::PooledSession. 

Today the application crashed because methods createCachedProducer and
createCachedConsumer do not synchronize access to their shared
ResourceLifecycleManager, and ResourceLifecycleManager itself is not

Relevant parts of the code are:

activemq\cmsutil\pooledsession.cpp line 101

            // Add the producer resource to the resource lifecycle manager.
            pool->getResourceLifecycleManager()->addMessageProducer( p );

activemq\cmsutil\resourcelifecyclemanager.h line 95:

        void addMessageProducer( cms::MessageProducer* producer ) {
            producers.push_back( producer );

I think, ResourceLifecycleManager needs to be thread-safe, i.e. we need to
add synchronization to all of its add* methods.

Any suggestions? Maybe I misuse SessionPool or PooledSession somehow?

Best regards, Ivan
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message