mirror of https://github.com/apache/activemq.git
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:
parent
75c9b638be
commit
2acf76e923
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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, "", "" );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue