-Spring Boot technology stack sizing is based on micro-service architecture practice of CSE

Copyright: Huawei cloud All rights reserved Please indicate the source https://blog.csdn.net/devcloud/article/details/91813488

Abstract In a previous article "Service-based micro-architecture practice of CSE - infrastructure" based on the integrated CSE introduced in Spring Boot in technology selection reference. This paper introduces the basic principles and workflow Spring Boot integration of CSE, Spring Boot micro component selection of reference services development, and selection considerations of CSE's Edge Service.

The Boot Spring Spring technology enables users to develop applications more easily, while Spring art JAVA frame is widely used. It provides a large number of components for developers to use, the user can simplify the development step, to enhance development efficiency. CSE can well be integrated Spring Boot, after integration, using CSE running operation, the ability to provide a variety of ready to use out of the box CSE can be used, while providing good development of other components Spring Boot provided.

CSE in Spring Boot principle is the integration of REST framework for Spring MVC (DispatcherServlet) provide replacement REST framework for CSE (RestServlet) provides.

image.png

Both frameworks also can co-exist, just to give two different Servlet specified URL prefix can be.

server.servlet.path=/mvc
servicecomb.rest.servlet.urlPattern=/cse/*

Spring MVC and CSE have adopted the label defined REST interface Spring MVC provides, CSE support the set of tags is Spring MVC subset, CSE removed some development support does not meet the Open API requirements, requiring developers to define interfaces when more specification. This means that users at any time, can be very easy to develop applications CSE replace Spring Boot applications without the need to make any changes.

The essential difference is that the CSE Spring MVC and processes. Spring MVC main operating logic in the client includes a series of MessageConverters, at DispatcherServlet, various filters can be injected (the Filter) and the interceptor (Interceptor) by the user, the service processing logic in the primary side.

image.png

CSE operating logic is characterized by a unified processing model client and server, a series of flexible configuration Hanlder, and contract and the introduction of asynchronous processing mechanism.

image.png

Due to a series of development capabilities CSE offers are out of the box, it is possible to quickly build commercial properties in Spring Boot application. Meanwhile CSE introduced the Open API as the basis for the entire operation, better able to service control interface and provides a great deal of innovation.

Under Spring Boot selection, users can use a lot of Spring Boot Starters to meet business development needs.

From the above function to see, in addition to the gateway service users to develop basic habits and Spring Boot consistent. Selection of the above gateway continue to use CSE Edge Service, because other gateways do not provide "interface is compatible forwarding capability," the ability to be able to provide only the CSE framework, this feature is useful in applications such as gray-scale publishing scenarios, allowing users to more than a micro-service version is not compatible with the coexistence can be achieved is not compatible with scene upgrade zero interruption.

 image.png

The above shows how "interface is compatible forwarding capability" works. Another reason for using CSE Edge Service is that it provides the original routing scalability and asynchronous programming capabilities. Open the original route expansion capability allows users to customize a variety of complex routing rules of freedom, in this single application requires transformation "continuous iterative evolution," the coexistence of multiple development technologies and routing rules that require frequent adjustment scenario is very important, and asynchronous programming capabilities for performance optimization are very important. Of course, flexible customization capability and asynchronous programming interface makes Edge Service on use is complicated. From experience, it is necessary to understand this complexity, the gateway in business systems actor pivotal role, developers need to understand how it works, in order to better enable applications to adapt to a variety of complex performance optimization needs. Of course, it is not difficult to master this complexity, although the coding complexity, but features a single gateway, with the depth of skills to master optimization techniques is very rapid. To "business" set the necessary skills, technology allows developers to keep warm, and sometimes there will be a windfall.

 

 Source: Huawei cloud community  Author: liubao68

Guess you like

Origin blog.csdn.net/devcloud/article/details/91813488