kaiser20106 opened a new issue, #737:
URL: https://github.com/apache/rocketmq-spring/issues/737
启动日志
> 2025-07-20 02:41:31.898 [main] INFO
o.a.r.c.a.ListenerContainerConfiguration - Register the listener to container,
listenerBeanName:normalTopicConsumer,
containerBeanName:org.apache.rocketmq.client.support.DefaultListenerContainer_3
> 2025-07-20 02:41:33.304 [main] INFO o.a.r.c.s.DefaultListenerContainer -
running container:
DefaultListenerContainer{name='org.apache.rocketmq.client.support.DefaultListenerContainer_3',
running=true, accessKey='', secretKey='', endpoints='192.168.2.177:8081',
consumerGroup='springboot_consumer_group_normal', tag='*', topic='NormalTopic',
type='tag', filterExpressionType=null, requestTimeout=PT3S,
maxCachedMessageCount=1024, maxCacheMessageSizeInBytes=67108864,
consumptionThreadCount=20, namespace=''}
> 2025-07-20 02:41:33.337 [main] INFO org.example.cloud.CloudApplication -
Started CloudApplication in 4.123 seconds (process running for 4.814)
```
rocketmq:
producer:
endpoints: 192.168.2.177:8081
tag: "*"
topics:
normal: NormalTopic
consumer:
groups:
normal: springboot_consumer_group_normal
//生产者
Message<String> message = MessageBuilder.withPayload("sync").build();
SendReceipt sendReceipt =
rocketMQClientTemplate.syncSendNormalMessage(normalTopic, message);
log.info("普通消息发送成功,sendReceipt:{}", sendReceipt);
return sendReceipt;
//消费者
@Slf4j
@Service
@RocketMQMessageListener(endpoints = "${rocketmq.producer.endpoints}", topic
= "${rocketmq.topics.normal}", consumerGroup =
"${rocketmq.consumer.groups.normal}", tag = "${rocketmq.tag}")
public class NormalTopicConsumer implements RocketMQListener {
@Override
public ConsumeResult consume(MessageView messageView) {
log.info("NormalTopicConsumer,接收成功:{}", messageView);
log.info("body,接收成功:{}", messageView.getBody());
log.info("group,接收成功:{}", messageView.getMessageGroup());
return ConsumeResult.SUCCESS;
}
}
```
> 2025-07-20 02:30:45.503 [http-nio-7888-exec-1] INFO
o.e.c.r.s.ProducerController -
普通消息发送成功,sendReceipt:SendReceiptImpl{messageId=0100155D939C9A3C18088D7E5500000000}
> 2025-07-20 02:30:45.511 [RocketmqMessageConsumption-2-78] INFO
o.e.c.r.s.c.NormalTopicConsumer -
NormalTopicConsumer,接收成功:MessageViewImpl{messageId=0100155D939C9A3C18088D7E5500000000,
topic=NormalTopic, bornHost=DESKTOP-VSOC5FB, bornTimestamp=1752949845410,
endpoints=ipv4:192.168.2.177:8081, deliveryAttempt=1, tag=null, keys=[],
messageGroup=null, deliveryTimestamp=null,
properties={id=081dd3ee-ae98-f656-e0eb-241d73ae36d6,
contentType=text/plain;charset=UTF-8, timestamp=1752949845354}}
> 2025-07-20 02:30:45.511 [RocketmqMessageConsumption-2-78] INFO
o.e.c.r.s.c.NormalTopicConsumer - body,接收成功:java.nio.HeapByteBufferR[pos=0
lim=4 cap=4]
> 2025-07-20 02:30:45.511 [RocketmqMessageConsumption-2-78] INFO
o.e.c.r.s.c.NormalTopicConsumer - group,接收成功:Optional.empty
接收成功但是日志显示messageGroup=null
group为空,为什么控制台还能打印NormalTopicConsumer,接收成功:MessageViewImpl{messageId=0100155D939C9A3C18088D7E5500000000.....
换**rocketmq-spring-boot-starter**状态变成CONSUMED
<img width="798" height="217" alt="Image"
src="https://github.com/user-attachments/assets/999f5db3-3330-4872-80d5-aa4acd7bc23c"
/>
--
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]