ShannonDing opened a new issue, #5131:
URL: https://github.com/apache/rocketmq/issues/5131
The producer instance should be shutdown after sending namespacing messages.
```
public static void main(String[] args) throws Exception {
DefaultMQProducer producer = new DefaultMQProducer(NAMESPACE,
PRODUCER_GROUP);
producer.setNamesrvAddr(DEFAULT_NAMESRVADDR);
producer.start();
for (int i = 0; i < MESSAGE_COUNT; i++) {
Message message = new Message(TOPIC, TAG, "Hello
world".getBytes(StandardCharsets.UTF_8));
try {
SendResult result = producer.send(message);
System.out.printf("Topic:%s send success, misId is:%s%n",
message.getTopic(), result.getMsgId());
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
https://github.com/apache/rocketmq/blob/develop/example/src/main/java/org/apache/rocketmq/example/namespace/ProducerWithNamespace.java
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]