You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2010/06/07 21:31:04 UTC
svn commit: r952383 -
/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp
Author: tabish
Date: Mon Jun 7 19:31:03 2010
New Revision: 952383
URL: http://svn.apache.org/viewvc?rev=952383&view=rev
Log:
Adds some notes on how to use SSL transport.
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp?rev=952383&r1=952382&r2=952383&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/examples/main.cpp Mon Jun 7 19:31:03 2010
@@ -126,6 +126,8 @@ public:
producer->send( message );
delete message;
+
+ Thread::sleep( 500 );
}
}catch ( CMSException& e ) {
@@ -350,6 +352,7 @@ int main(int argc AMQCPP_UNUSED, char* a
std::cout << "Starting the example:" << std::endl;
std::cout << "-----------------------------------------------------\n";
+
// Set the URI to point to the IP Address of your broker.
// add any optional params to the url to enable things like
// tightMarshalling or tcp logging etc. See the CMS web site for
@@ -358,7 +361,7 @@ int main(int argc AMQCPP_UNUSED, char* a
// http://activemq.apache.org/cms/
//
// Wire Format Options:
- // =====================
+ // =========================
// Use either stomp or openwire, the default ports are different for each
//
// Examples:
@@ -366,13 +369,29 @@ int main(int argc AMQCPP_UNUSED, char* a
// tcp://127.0.0.1:61616?wireFormat=openwire same as above
// tcp://127.0.0.1:61613?wireFormat=stomp use stomp instead
//
+ // SSL:
+ // =========================
+ // To use SSL you need to specify the location of the trusted Root CA or the
+ // certificate for the broker you want to connect to. Using the Root CA allows
+ // you to use failover with multiple servers all using certificates signed by
+ // the trusted root. If using client authentication you also need to specify
+ // the location of the client Certificate.
+ //
+ // System::setProperty( "decaf.net.ssl.keyStore", "<path>/client.pem" );
+ // System::setProperty( "decaf.net.ssl.keyStorePassword", "password" );
+ // System::setProperty( "decaf.net.ssl.trustStore", "<path>/rootCA.pem" );
+ //
+ // The you just specify the ssl transport in the URI, for example:
+ //
+ // ssl://localhost:61617
+ //
std::string brokerURI =
- "failover:(tcp://127.0.0.1:61616"
+ "failover:(tcp://localhost:61616"
// "?wireFormat=openwire"
// "&transport.useInactivityMonitor=false"
// "&connection.alwaysSyncSend=true"
// "&connection.useAsyncSend=true"
-// "&transport.commandTracingEnabled=true"
+// "?transport.commandTracingEnabled=true"
// "&transport.tcpTracingEnabled=true"
// "&wireFormat.tightEncodingEnabled=true"
")";
@@ -384,7 +403,7 @@ int main(int argc AMQCPP_UNUSED, char* a
//============================================================
bool useTopics = true;
bool sessionTransacted = false;
- int numMessages = 2000;
+ int numMessages = 20000;
long long startTime = System::currentTimeMillis();