Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

SpringBoot Integration RocketMQ error reporting: the solution of Bad annotation definition in @ ExtRocketMQTemplateConfiguration

Shulou Source: shulou.com Published: 2022-06-02 09:32:31 10月03日 Update

This article mainly explains "SpringBoot integrated RocketMQ error reporting: the solution of Bad annotation definition in @ ExtRocketMQTemplateConfiguration". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "SpringBoot integrated RocketMQ error reporting: Bad annotation definition in @ ExtRocketMQTemplateConfiguration solution".

1. Cause of the problem

When writing ExtRocketMQTemplate using the official example provided by rocketmq-spring-boot-starter, the nameServer configuration in the configuration file is modified to the same value as rocketmq.name-server:

# # configuration file rocketmq: name-server: 192.168.2.182 rocketmq 9876 * ExtNameServer: 192.168.2.182 public class ExtRocketMQTemplate extends RocketMQTemplate 9876 Java Code@ExtRocketMQTemplateConfiguration (nameServer = "${demo.rocketmq.extNameServer}") Problem description

Stack information is posted:

Org.springframework.beans.factory.support.BeanDefinitionValidationException: Bad annotation definition in @ ExtRocketMQTemplateConfiguration, nameServer property is same with global property, please use the default RocketMQTemplate! At org.apache.rocketmq.spring.autoconfigure.ExtProducerResetConfiguration.validate (ExtProducerResetConfiguration.java:153) ~ [rocketmq-spring-boot-2.0.3.jar:2.0.3] at org.apache.rocketmq.spring.autoconfigure.ExtProducerResetConfiguration.registerTemplate (ExtProducerResetConfiguration.java:88) ~ [rocketmq-spring-boot-2.0.3.jar:2.0.3] at java.util.LinkedHashMap.forEach (LinkedHashMap.java:684) ~ [na:1.8.0_144 ] at org.apache.rocketmq.spring.autoconfigure.ExtProducerResetConfiguration.afterSingletonsInstantiated (ExtProducerResetConfiguration.java:75) ~ [rocketmq-spring-boot-2.0.3.jar:2.0.3]. 3. Problem solving

According to the error prompt, nameServer cannot be set to the same value as the above rocketmq.name-server. A different value can solve this problem:

Rocketmq: name-server: 192.168.2.182 properties used in the applicationdemo 9876 * 192.168.2.183 * 9876. ExtNameServer: 192.168.2.182 Bad annotation definition in 9876 Thank you for your reading, the above is the content of "SpringBoot integrated RocketMQ error reporting: Bad annotation definition in @ ExtRocketMQTemplateConfiguration solution". After the study of this article, I believe you have a deeper understanding of the problem of SpringBoot integrated RocketMQ error reporting: Bad annotation definition in @ ExtRocketMQTemplateConfiguration solution, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Questions methods learning configuration content files examples information stacks official that is ideas situations articles times more knowledge knowledge points articles reasons Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Huawei vpn MariaDB Shulou Tech Info