Skip to content

Commit

Permalink
[ISSUE #291] Use separate factory for trace producer of push consumer.
Browse files Browse the repository at this point in the history
fix(trace): use a separate factory for trace producer of push consumer.
  • Loading branch information
ShannonDing authored Mar 27, 2020
1 parent 2da0647 commit 6171577
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/consumer/DefaultMQPushConsumerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ bool DefaultMQPushConsumerImpl::dealWithMessageTrace() {
void DefaultMQPushConsumerImpl::createMessageTraceInnerProducer() {
m_DefaultMQProducerImpl = std::make_shared<DefaultMQProducerImpl>(getGroupName());
m_DefaultMQProducerImpl->setMessageTrace(false);
m_DefaultMQProducerImpl->setInstanceName(getInstanceName());
m_DefaultMQProducerImpl->setInstanceName("MESSAGE_TRACE_" + getInstanceName());
const SessionCredentials& session = getSessionCredentials();
m_DefaultMQProducerImpl->setSessionCredentials(session.getAccessKey(), session.getSecretKey(),
session.getAuthChannel());
Expand All @@ -1109,15 +1109,15 @@ void DefaultMQPushConsumerImpl::createMessageTraceInnerProducer() {
}
m_DefaultMQProducerImpl->setNameSpace(getNameSpace());
// m_DefaultMQProducerImpl->setNamesrvDomain(getNamesrvDomain());
m_DefaultMQProducerImpl->start(false);
m_DefaultMQProducerImpl->start();
}
void DefaultMQPushConsumerImpl::shutdownMessageTraceInnerProducer() {
if (!getMessageTrace()) {
return;
}
if (m_DefaultMQProducerImpl) {
LOG_INFO("Shutdown Message Trace Inner Producer In Consumer.");
m_DefaultMQProducerImpl->shutdown(false);
m_DefaultMQProducerImpl->shutdown();
}
}
bool DefaultMQPushConsumerImpl::hasConsumeMessageHook() {
Expand Down

0 comments on commit 6171577

Please sign in to comment.