Hi Tim, The broker is running in the specified port. But the sample given with activemq-cpp is running fine. The only difference is that my sample is an executable. The activemq sample output is in text format.
Thanks, Radha. On Thu, Jun 9, 2011 at 8:13 PM, Timothy Bish [via ActiveMQ] < ml-node+3585765-1108352484-139...@n4.nabble.com> wrote: > On Wed, 2011-06-08 at 21:38 -0700, Radha Manickam wrote: > > > Hi Tim, > > > > I didnt get any error. But the sample application i hanging somewhere. > > So I have added some debug strings in the activemq library and tried. > > > > It is hanging in the method Connection->Start. > > After some debugging i found that it got struck in the method syncRequest > in > > the ActiveMQConnection class(while getting the response from the > transport. > > > > I have pasted the code with the debug strings that i have added: > > > > Pointer<Response> ActiveMQConnection::syncRequest( Pointer<Command> > command, > > unsigned int timeout ) { > > > > try { > > cout << "Entering sycnRequest\n"; > > checkClosedOrFailed(); > > cout << "Checked if closed or failed\n"; > > Pointer<Response> response; > > cout << "Checking for the timeout value\n"; > > if( timeout == 0 ) { > > cout << "Timeout is zero\n"; > > response = this->config->transport->request( command ); > > } else { > > cout << "Timeout is non-zero\n"; > > response = this->config->transport->request( command, timeout > ); > > } > > cout << "Creating the exception response\n"; > > commands::ExceptionResponse* exceptionResponse = > > dynamic_cast<ExceptionResponse*>( response.get() ); > > cout << "Created\n"; > > if( exceptionResponse != NULL ) { > > cout << "Exception response is not null\n"; > > // Create an exception to hold the error information. > > BrokerException exception( __FILE__, __LINE__, > > exceptionResponse->getException().get() ); > > cout << "throwing the the exception response\n"; > > // Throw the exception. > > throw exception; > > } > > cout << "Leaving and returning the response\n"; > > return response; > > } > > AMQ_CATCH_RETHROW( ActiveMQException ) > > AMQ_CATCH_EXCEPTION_CONVERT( IOException, ActiveMQException ) > > AMQ_CATCH_EXCEPTION_CONVERT( > > decaf::lang::exceptions::UnsupportedOperationException, ActiveMQException > ) > > AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException ) > > AMQ_CATCHALL_THROW( ActiveMQException ) > > } > > > > > > The output i got is as follows: > > > > Pinging the broker > > Entering sycnRequest > > Checked if closed or failed > > Checking for the timeout value > > Timeout is zero > > > > After this line the application got hanged. > > > > > > > That sounds like normal behavior when the client is attempting to > connect but there is no broker available and you have the failover > transport enabled. Is there a broker running on the ip / port you've > specified? > > Regards > > -- > Tim Bish > ------------ > FuseSource > Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=3585765&i=0> > Web: http://fusesource.com > Twitter: tabish121 > Blog: http://timbish.blogspot.com/ > > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://activemq.2283324.n4.nabble.com/Connection-problem-in-using-Activemq-CPP-tp3579368p3585765.html > To unsubscribe from Connection problem in using Activemq-CPP, click > here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3579368&code=cmFkaGFtYW5pY2thbUBnbWFpbC5jb218MzU3OTM2OHwtMTc1OTA2NDE2Ng==>. > > -- View this message in context: http://activemq.2283324.n4.nabble.com/Connection-problem-in-using-Activemq-CPP-tp3579368p3587402.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.