activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r725692 - /activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp
Date Thu, 11 Dec 2008 14:18:15 GMT
Author: tabish
Date: Thu Dec 11 06:18:15 2008
New Revision: 725692

URL: http://svn.apache.org/viewvc?rev=725692&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-212

Update sample to display a better error when the broker can't be contacted.

Modified:
    activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp

Modified: activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp?rev=725692&r1=725691&r2=725692&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp (original)
+++ activemq/activemq-cpp/trunk/src/examples/topics/chat/Chat.cpp Thu Dec 11 06:18:15 2008
@@ -77,6 +77,15 @@
         this->connection.reset(
             connectionFactory->createConnection( this->getUsername(), this->getPassword()
) );
 
+    } catch( cms::CMSException& ex ) {
+        std::cout << "==================================================" <<
std::endl;
+        std::cout << "= Failed to Connect To Broker, Is it Running?    =" <<
std::endl;
+        std::cout << "==================================================" <<
std::endl;
+        return;
+    }
+
+    try{
+
         this->session.reset( this->connection->createSession( cms::Session::AUTO_ACKNOWLEDGE
) );
         this->topic.reset( this->session->createTopic( this->getTopicName() )
);
         this->producer.reset( this->session->createProducer( this->topic.get()
) );



Mime
View raw message