apache / apache/rocketmq-spring

RocketMQ 5.0 client messageGroup not online

Open
#737 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.3k
Forks
943
PR merge metrics
No merged PRs in 30d

Description

启动日志
> 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 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

Image

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the rocketmq-spring-boot-starter configuration, @RocketMQMessageListener usage, and MessageView.getMessageGroup in the provided producer and consumer example. Reproduce the NormalTopic flow and compare the received MessageView and console status before and after changing the starter; done means explaining or correcting why messageGroup is empty while consumption succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.