提交 3884536c 编写于 作者: L lollipop

[ISSUE #1120] Add new feature: support namespace

上级 f3d8d38f
......@@ -30,7 +30,7 @@ public class ProducerWithNamespace {
Message message = new Message("topicTest", "tagTest", "Hello world".getBytes());
try {
SendResult result = producer.send(message);
System.out.println("Topic:" + message.getTopic() + " send success, msgId is:" + result.getMsgId());
System.out.printf("Topic:%s send success, misId is:%s%n", message.getTopic(), result.getMsgId());
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -79,7 +79,7 @@ public class PullConsumerWithNamespace {
return;
}
pullResult.getMsgFoundList().stream().forEach(
(msg) -> System.out.println("Topic is:" + msg.getTopic() + "msgId is:" + msg.getMsgId()));
(msg) -> System.out.printf("Topic is:%s, msgId is:%s%n" , msg.getTopic(), msg.getMsgId()));
}
private static void putMessageQueueOffset(MessageQueue mq, long offset) {
......
......@@ -27,9 +27,9 @@ public class PushConsumerWithNamespace {
defaultMQPushConsumer.subscribe("topicTest", "*");
defaultMQPushConsumer.registerMessageListener((MessageListenerConcurrently)(msgs, context) -> {
msgs.stream().forEach((msg) -> {
System.out.println("Msg topic is:" + msg.getTopic() + " MsgId is:" + msg.getMsgId());
System.out.printf("Msg topic is:%s, MsgId is:%s, reconsumeTimes is:%s%n", msg.getTopic() , msg.getMsgId(), msg.getReconsumeTimes());
});
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
return ConsumeConcurrentlyStatus.RECONSUME_LATER;
});
defaultMQPushConsumer.start();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册