You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/04/23 07:58:46 UTC
[GitHub] [rocketmq-spring] naah69 opened a new issue #254: error when same consumer group subscribe multi topics
naah69 opened a new issue #254:
URL: https://github.com/apache/rocketmq-spring/issues/254
**BUG REPORT**
1. Please describe the issue you observed:
in one application,i use same consumer group subscribe multi topics,then application can't run with the info .
```
The consumer group[group1] has been created before, specify another name please.
```
### code


### error log
```
2020-04-23 15:53:17.613 ERROR [main] org.springframework.boot.SpringApplication Line:826 - Application run failed
java.lang.RuntimeException: java.lang.IllegalStateException: Failed to start RocketMQ push consumer
at org.apache.rocketmq.spring.autoconfigure.ListenerContainerConfiguration.registerContainer(ListenerContainerConfiguration.java:123)
at java.util.HashMap.forEach(HashMap.java:1289)
at org.apache.rocketmq.spring.autoconfigure.ListenerContainerConfiguration.afterSingletonsInstantiated(ListenerContainerConfiguration.java:79)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:899)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at com.manfu.StartApplication.main(StartApplication.java:20)
Caused by: java.lang.IllegalStateException: Failed to start RocketMQ push consumer
at org.apache.rocketmq.spring.support.DefaultRocketMQListenerContainer.start(DefaultRocketMQListenerContainer.java:281)
at org.apache.rocketmq.spring.autoconfigure.ListenerContainerConfiguration.registerContainer(ListenerContainerConfiguration.java:120)
... 12 common frames omitted
Caused by: org.apache.rocketmq.client.exception.MQClientException: The consumer group[group1] has been created before, specify another name please.
See http://rocketmq.apache.org/docs/faq/ for further details.
at org.apache.rocketmq.client.impl.consumer.DefaultMQPushConsumerImpl.start(DefaultMQPushConsumerImpl.java:629)
at org.apache.rocketmq.client.consumer.DefaultMQPushConsumer.start(DefaultMQPushConsumer.java:693)
at org.apache.rocketmq.spring.support.DefaultRocketMQListenerContainer.start(DefaultRocketMQListenerContainer.java:279)
... 13 common frames omitted
```
2. Please tell us about your environment:
jdk8
rocketmq-spring-boot-starter 2.1.0
rocketmq 4.4.0
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-spring] sdmq removed a comment on issue #254: error when same consumer group subscribe multi topics
Posted by GitBox <gi...@apache.org>.
sdmq removed a comment on issue #254:
URL: https://github.com/apache/rocketmq-spring/issues/254#issuecomment-785536317
**分析原因:**
package org.apache.rocketmq.client.consumer.store;
public class LocalFileOffsetStore implements OffsetStore {
..................
public LocalFileOffsetStore(MQClientInstance mQClientFactory, String groupName) {
this.mQClientFactory = mQClientFactory;
this.groupName = groupName;
this.storePath = LOCAL_OFFSET_STORE_DIR + File.separator + this.mQClientFactory.getClientId() + File.separator + this.groupName + File.separator + "offsets.json";
}
加载本地json 时出错,
**解决办法:**
根据LOCAL_OFFSET_STORE_DIR 这个目录 找到目录 一块删除了就可以
以windows为例:
C:\Users\{登录用户}\.rocketmq_offsets
删除这个目录下所有文件即可
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-spring] sdmq commented on issue #254: error when same consumer group subscribe multi topics
Posted by GitBox <gi...@apache.org>.
sdmq commented on issue #254:
URL: https://github.com/apache/rocketmq-spring/issues/254#issuecomment-785536317
**分析原因:**
package org.apache.rocketmq.client.consumer.store;
public class LocalFileOffsetStore implements OffsetStore {
..................
public LocalFileOffsetStore(MQClientInstance mQClientFactory, String groupName) {
this.mQClientFactory = mQClientFactory;
this.groupName = groupName;
this.storePath = LOCAL_OFFSET_STORE_DIR + File.separator + this.mQClientFactory.getClientId() + File.separator + this.groupName + File.separator + "offsets.json";
}
加载本地json 时出错,
**解决办法:**
根据LOCAL_OFFSET_STORE_DIR 这个目录 找到目录 一块删除了就可以
以windows为例:
C:\Users\{登录用户}\.rocketmq_offsets
删除这个目录下所有文件即可
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-spring] RongtongJin commented on issue #254: error when same consumer group subscribe multi topics
Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #254:
URL: https://github.com/apache/rocketmq-spring/issues/254#issuecomment-618758352
Hi @naah69 Plz refer to Article 3 of the [wiki FAQ](
https://github.com/apache/rocketmq-spring/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98). if you must do it, you can set different instance name for consumer in prepareStart method.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org