-
Notifications
You must be signed in to change notification settings - Fork 940
Description
只要在RocketMQMessageListener里面配置namespace启动时就出现异常,不配置没问题
@Component @AllArgsConstructor @RocketMQMessageListener( consumerGroup = RocketMQConstants.ConsumerGroup.MERCHANT, topic = RocketMQConstants.Topic.TOPIC_TEST_ROCKETMQ ,namespace = "uat" ) public class TestMQListener implements RocketMQListener
pom依赖:
<dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-v5-client-spring-boot-starter</artifactId> <version>2.3.3</version> </dependency>
配置项如下:
rocketmq: producer: topic: TP_DEFAULT_BUSINESS endpoints: xxx namespace: uat push-consumer: endpoints: xxx tag: '*' topic: TP_DEFAULT_BUSINESS namespace: uat
异常:
`Started container failed. DefaultListenerContainer{name='org.apache.rocketmq.client.support.DefaultListenerContainer_2', running=false, accessKey='', secretKey='', endpoints='', consumerGroup='CG_MERCHANT', tag='*', topic='TP_TEST_ROCKETMQ', type='tag', filterExpressionType=null, requestTimeout=PT3S, maxCachedMessageCount=1024, maxCacheMessageSizeInBytes=67108864, consumptionThreadCount=20, namespace='uat'}
java.lang.IllegalStateException: Failed to start RocketMQ push consumer
at org.apache.rocketmq.client.support.DefaultListenerContainer.start(DefaultListenerContainer.java:332) ~[rocketmq-v5-client-spring-boot-2.3.3.jar:2.3.3]
at org.apache.rocketmq.client.autoconfigure.ListenerContainerConfiguration.startContainer(ListenerContainerConfiguration.java:85) ~[rocketmq-v5-client-spring-boot-2.3.3.jar:2.3.3]
at org.apache.rocketmq.client.annotation.RocketMQMessageListenerBeanPostProcessor.start(RocketMQMessageListenerBeanPostProcessor.java:73) ~[rocketmq-v5-client-spring-boot-2.3.3.jar:2.3.3]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:285) ~[spring-context-6.1.15.jar:6.1.15]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:472) ~[spring-context-6.1.15.jar:6.1.15]
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:257) ~[spring-context-6.1.15.jar:6.1.15]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:202) ~[spring-context-6.1.15.jar:6.1.15]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:990) ~[spring-context-6.1.15.jar:6.1.15]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:628) ~[spring-context-6.1.15.jar:6.1.15]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.3.6.jar:3.3.6]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.3.6.jar:3.3.6]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.3.6.jar:3.3.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[spring-boot-3.3.6.jar:3.3.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363) ~[spring-boot-3.3.6.jar:3.3.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352) ~[spring-boot-3.3.6.jar:3.3.6]
at com.yts.yyt.merchant.YytMerchantApplication.main(YytMerchantApplication.java:32) ~[classes/:na]
Caused by: java.lang.IllegalStateException: Expected the service PushConsumerImpl-1 [FAILED] to be RUNNING, but the service has FAILED
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:381) ~[rocketmq-client-java-5.0.7.jar:na]
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:305) ~[rocketmq-client-java-5.0.7.jar:na]
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractIdleService.awaitRunning(AbstractIdleService.java:165) ~[rocketmq-client-java-5.0.7.jar:na]
at org.apache.rocketmq.client.java.impl.consumer.PushConsumerBuilderImpl.build(PushConsumerBuilderImpl.java:128) ~[rocketmq-client-java-5.0.7.jar:na]
at org.apache.rocketmq.client.support.DefaultListenerContainer.start(DefaultListenerContainer.java:330) ~[rocketmq-v5-client-spring-boot-2.3.3.jar:2.3.3]
... 16 common frames omitted`