SpringBoot basics: integrating Dubbo

1. Basic knowledge

a. Interface engineering: stores the Model and Service interfaces
b. Service provider: The implementation class of the service interface exposes the service, registers it in the registration center, and calls the data persistence layer. (big head)

  • Add dependencies (dubbo, registration center, interface project)
  • Configure core configuration file

c. Service consumer: handles browser requests and calls services provided by service providers from the registration center

  • Add dependencies (dubbo, registration center, interface project)
  • Configure core configuration file

2. Service consumers find service providers

  • 1 Use @Componentannotations to put the service interface implementation class into the springboot container.
  • 2 Use dubbo @Serviceannotations to register the service interface implementation class to the registration center.
  • 3 Use dubbo @Referenceannotations to call the service interface implementation class (@Autowired is no longer used).
  • 4 Add dubbo startup annotations to the service provider and service consumer startup classes. @EnableDubboConfiguration.
    Notice:
  • @Serviceand @Referenceare all dubbocomments.

Guess you like

Origin blog.csdn.net/qq_38662733/article/details/121494420