问题描述
我的某些系统不会安装activeMQ代理,但是代码在那里。
我试图在ActiveMQConnection::ensureConnectionInfoSent : syncRequest(this->config->connectionInfo,500);
内添加超时
当代理处于活动状态时,它可以正常工作。但是,当我停止代理并尝试再次初始化连接时,它卡住了。
该函数的for包括我的prionts:
void ActiveMQConnection::ensureConnectionInfoSent() {
try {
// Can we skip sending the ConnectionInfo packet,cheap test
if (this->config->isConnectionInfoSentTobroker || closed.get()) {
return;
}
synchronized(&( this->config->ensureConnectionInfoSentMutex)) {
// Can we skip sending the ConnectionInfo packet??
if (this->config->isConnectionInfoSentTobroker || closed.get()) {
return;
}
// check for a user specified Id
if (!this->config->userSpecifiedClientID) {
this->config->connectionInfo->setClientId(this->config->clientIdGenerator->generateId());
}
// Now we ping the broker and see if we get an ack / nack
//syncRequest(this->config->connectionInfo,this->config->connectResponseTimeout);
fprintf(stdout,"talg ensureConnectionInfoSent before calling syncRequest\n");//talg
syncRequest(this->config->connectionInfo,1); /* talg */
fprintf(stdout,"talg ensureConnectionInfoSent after calling syncRequest\n");//talg
this->config->isConnectionInfoSentTobroker = true;
Pointer<SessionId> sessionId(new SessionId(this->config->connectionInfo->getConnectionId().get(),-1));
Pointer<ConsumerId> consumerId(new ConsumerId(*sessionId,this->config->consumerIdGenerator.getNextSequenceId()));
if (this->config->watchTopicAdvisories) {
fprintf(stdout,"talg inside ensureConnectionInfoSent 500\n");//talg
this->config->advisoryConsumer.reset(new AdvisoryConsumer(this,consumerId));
}
fprintf(stdout,"talg inside ensureConnectionInfoSent 2\n");//talg
}
fprintf(stdout,"talg inside ensureConnectionInfoSent 3\n");//talg
}
AMQ_CATCH_RETHROW(ActiveMQException)
AMQ_CATCH_EXCEPTION_CONVERT(Exception,ActiveMQException)
AMQ_CATCHALL_THROW(ActiveMQException)
fprintf(stdout,"talg end of ensureConnectionInfoSent\n");//talg
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)