Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report