Add default consumer namespace to DefaultRocketMQListenerContainer
The issue tracker is ONLY used for bug report and feature request.
Any question or RocketMQ proposal please use our mailing lists.
FEATURE REQUEST
-
Please describe the feature you are requesting. 2.2.2版本添加了namespace配置,但是对于@RocketMQMessageListener,需要在每个注解中设置namespace, 能否通过rocketmq.consumer.namespace设置默认的namespace?
-
Provide any additional detail on your proposed use case for this feature.
private DefaultRocketMQListenerContainer createRocketMQListenerContainer(String name, Object bean,
RocketMQMessageListener annotation) {
......
container.setMessageConverter(rocketMQMessageConverter.getMessageConverter());
container.setName(name);
// set default namespace
String namespace = rocketMQProperties.getConsumer().getNamespace();
if (StringUtils.isEmpty(container.getNamespace()) && !StringUtils.isEmpty(namespace)) {
container.setNamespace(namespace);
}
return container;
}
- Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue? should-have
namespace is used for logical isolation. If a default value is set for namespace, the actual resource will become namespace%topic or namespace%group, which is not friendly to users of rocketmq who are not familiar with it.
I only add the default namespace for consumer, not both producer and consumer, which may not works well. I will test it, if there are any questions, I will submit another PR to fix it.