I am writing a C++ application using the ActiveMQ CPP API. I have based my code on the example in http://activemq.apache.org/cms/example.html
However I have moved the creation of the Session, Destination and Consumer objects of the Consumer class to the constructor. I understand that some of these objects are not thread safe but, since I am not using them from different threads simultaneously, then this should be OK? The reason is that the ActiveMQConsumer object is crashing during its destruction.