You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by nm...@apache.org on 2006/04/23 23:52:56 UTC

svn commit: r396325 - in /incubator/activemq/trunk/cms/activemqcms/src/activemq: ActiveMQConnectionFactory.cpp transport/stomp/StompTransportFactory.cpp

Author: nmittler
Date: Sun Apr 23 14:52:54 2006
New Revision: 396325

URL: http://svn.apache.org/viewcvs?rev=396325&view=rev
Log:
Fixed broker url for Jira issue AMQ-686

Modified:
    incubator/activemq/trunk/cms/activemqcms/src/activemq/ActiveMQConnectionFactory.cpp
    incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/StompTransportFactory.cpp

Modified: incubator/activemq/trunk/cms/activemqcms/src/activemq/ActiveMQConnectionFactory.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/activemqcms/src/activemq/ActiveMQConnectionFactory.cpp?rev=396325&r1=396324&r2=396325&view=diff
==============================================================================
--- incubator/activemq/trunk/cms/activemqcms/src/activemq/ActiveMQConnectionFactory.cpp (original)
+++ incubator/activemq/trunk/cms/activemqcms/src/activemq/ActiveMQConnectionFactory.cpp Sun Apr 23 14:52:54 2006
@@ -48,7 +48,7 @@
 	this->userName = userName;
 	this->password = password;
 
-    brokerUrl = brokerUrl;
+    this->brokerUrl = brokerUrl;
     
     transportFactory = new activemq::transport::stomp::StompTransportFactory();
 }

Modified: incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/StompTransportFactory.cpp
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/StompTransportFactory.cpp?rev=396325&r1=396324&r2=396325&view=diff
==============================================================================
--- incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/StompTransportFactory.cpp (original)
+++ incubator/activemq/trunk/cms/activemqcms/src/activemq/transport/stomp/StompTransportFactory.cpp Sun Apr 23 14:52:54 2006
@@ -26,8 +26,16 @@
 ////////////////////////////////////////////////////////////////////////////////
 Transport* StompTransportFactory::createTransport( const char* brokerUrl ){
     
-    brokerHost = "127.0.0.1";
-    brokerPort = 61626;
+    string temp = brokerUrl;
+    unsigned int ix = temp.find( ':' );
+    if( ix == string::npos ){
+        throw new ActiveMQException( "StompTransportFactory::createTransport - no port provided in url" );
+    }
+    
+    brokerHost = temp.substr(0,ix);
+    
+    sscanf(brokerUrl+ix+1, "%d", &brokerPort );
+    
     return new StompTransport( brokerHost.c_str(), brokerPort, "", "" );
 }