Fixed broker url for Jira issue AMQ-686

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@396325 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nathan Christopher Mittler 2006-04-23 21:52:54 +00:00
parent 75c9b638be
commit 2acf76e923
2 changed files with 11 additions and 3 deletions

View File

@ -48,7 +48,7 @@ ActiveMQConnectionFactory::ActiveMQConnectionFactory( const char* userName,
this->userName = userName;
this->password = password;
brokerUrl = brokerUrl;
this->brokerUrl = brokerUrl;
transportFactory = new activemq::transport::stomp::StompTransportFactory();
}

View File

@ -26,8 +26,16 @@ using namespace std;
////////////////////////////////////////////////////////////////////////////////
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, "", "" );
}