I wanted to give a head's up that there is a slight issue with the code posted 
at:
ActiveMQ (apache.org)<https://activemq.apache.org/components/cms/overview>

Current Version:
// Create a new Session from our Connection
std::auto_ptr<cms::Session> session( connection->createSession();

Corrected Version:
// Create a new Session from our Connection
std::auto_ptr<cms::Session> session( connection->createSession() );


Under "Creating a Message", there is a missing closing parenthesis after 
createSession():

// Create the ConnectionFactory
std::auto_ptr<cms::ConnectionFactory> connectionFactory(
    cms::ConnectionFactory::createCMSConnectionFactory( 
"tcp://127.0.0.1:61616<http://127.0.0.1:61616>" ) );

// Create a Connection
std::auto_ptr<cms::Connection> connection( 
connectionFactory->createConnection() );

// Create a new Session from our Connection
std::auto_ptr<cms::Session> session( connection->createSession();

// Now create a TextMessage
std::auto_ptr<cms::TextMessage> textMessage( session->createTextMessage() );

// Set the payload
textMessage->setText( "Payload Text" );

// Set some Properties
textMessage->setStringProperty( "USER_NAME", "Steve" );
textMessage->setIntProperty( "USER_CODE", 42 );

Best regards,
Erich Kring

Reply via email to