Author: tabish
Date: Wed Dec 23 01:13:35 2009
New Revision: 893371
URL: http://svn.apache.org/viewvc?rev=893371&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-273
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp?rev=893371&r1=893370&r2=893371&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/advisories/TempDestinationAdvisoryConsumerMain.cpp
Wed Dec 23 01:13:35 2009
@@ -48,35 +48,37 @@
//
std::string brokerURI = "failover:(tcp://127.0.0.1:61616)";
- // Create the Connection
- auto_ptr<cms::ConnectionFactory> connectionFactory(
- cms::ConnectionFactory::createCMSConnectionFactory( brokerURI ) );
-
- auto_ptr<cms::Connection> connection;
-
- // Create a Connection
- try{
- connection.reset( connectionFactory->createConnection() );
- } catch( CMSException& e ) {
- e.printStackTrace();
- return 1;
- }
-
- // Create the Session
- std::auto_ptr<cms::Session> session( connection->createSession() );
-
- // Create the Advisory Consumer and run it.
- TempDestinationAdvisoryConsumer advisoryConsumer( session.get() );
+ {
+ // Create the Connection
+ auto_ptr<cms::ConnectionFactory> connectionFactory(
+ cms::ConnectionFactory::createCMSConnectionFactory( brokerURI ) );
+
+ auto_ptr<cms::Connection> connection;
+
+ // Create a Connection
+ try{
+ connection.reset( connectionFactory->createConnection() );
+ } catch( CMSException& e ) {
+ e.printStackTrace();
+ return 1;
+ }
+
+ // Create the Session
+ std::auto_ptr<cms::Session> session( connection->createSession() );
+
+ // Create the Advisory Consumer and run it.
+ TempDestinationAdvisoryConsumer advisoryConsumer( session.get() );
+
+ // Start the Connection now.
+ connection->start();
+
+ // Wait until we are told to quit.
+ std::cout << "Press 'q' to quit" << std::endl;
+ while( std::cin.get() != 'q') {}
- // Start the Connection now.
- connection->start();
-
- // Wait until we are told to quit.
- std::cout << "Press 'q' to quit" << std::endl;
- while( std::cin.get() != 'q') {}
-
- // Shutdown now
- connection->stop();
+ // Shutdown now
+ connection->stop();
+ }
std::cout << "-----------------------------------------------------\n";
std::cout << "Finished with the example." << std::endl;
|