Broker配置
首先看下broker.conf配置的两个属性
| 属性 |默认值 |
| — | — |
|traceTopicEnable |false |
| msgTraceTopicName | RMQ_SYS_TRACE_TOPIC |
在一个集群中可以配置一台机器专门负责消息轨迹的收集工作,该台机器上配置traceTopicEnable = true,
borker启动的时候自动创建默认轨迹topic
TopicConfigManager.java构造方法,BrokerController在启动的时候,会初始化TopicConfigManager实现trace topic的创建工作
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| {
if (this.brokerController.getBrokerConfig().isTraceTopicEnable()) {
String topic = this.brokerController.getBrokerConfig().getMsgTraceTopicName();
TopicConfig topicConfig = new TopicConfig(topic);
this.systemTopicList.add(topic);
topicConfig.setReadQueueNums(1);
topicConfig.setWriteQueueNums(1);
this.topicConfigTable.put(topicConfig.getTopicName(), topicConfig);
}
}
|