In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Annotation-based Dubbo service configuration can greatly reduce the amount of Service configuration in the dubbo xml configuration file, the main steps are as follows:
I. Service provider
1. Add Dubbo annotation scan to Dubbo configuration file
Add Dubbo Service annotations to the 2.Service implementation class
Import com.alibaba.dubbo.config.annotation.Service;@Servicepublic class DubboServiceImpl implements DubboService {}
II. Service consumers
1. Add Dubbo annotation scan to Dubbo configuration file (same as service provider)
Introduce dubbo configuration into 2.Spring MVC configuration to solve the problem of incompatibility of dubbo annotations (it is critical, otherwise the introduction of services in the controller will report null pointers)
3. Once the Dubbo service is introduced into the controller, you can use the
@ Referenceprivate DubboService dubboService
The above annotation-based Dubbo service configuration method (example explanation) is all the content shared by the editor to you. I hope I can give you a reference and support it.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.