A Springboot scaffold project can be built through http://start.spring.io/.
One, micro-services
1. Springboot is a micro-framework that uses Java to build microservices.
2, micro-service is to advocate that we try to split the function, the service granularity small, so that it can independently assume the responsibility of external services, along this line of thought development and delivery of software services entity is called "micro-services."
3. Micro-Service Benefits
(1) Independence, independence, or independence. Every micro-service is a small kingdom, out of the reign of the "Unification" (Monolith) kingdom, began to build their own independence from all levels, so as to ensure that their small kingdom can continue to operate stably.
(2) Multi-language ecology. When microservices are independent, they give their teams and organizations the ability to iterate and deliver quickly, while also giving teams and organizations more flexibility, and in fact, the teams or organizations that deliver different microservices can now build on different computer language ecosystems.
II. Spring Framework Essence
1, Spring IoC (inversion of Control) actually has two forms, one is di (Dependency injection dependency inversion), the other is DL (Dependency lookup dependent lookup). Di is the current software entity passively accepts its dependent components are injected by the IOC container, the DL is the current software entity actively go to a service registry to find the services it relies on.
The dependency injection work of the Spring IOC container can be divided into two phases:
(1) Collection and registration: The stage for building and collecting bean definitions so that the IOC container is flooded with separate beans, and there is no relationship between them.
(2) Analysis and assembly: analyze these beans that are already in the IOC container and then assemble them according to their dependencies. If the IOC container discovers that a bean is dependent on another bean, it injects the other bean into the bean that relies on it until all the beans are injected and all the beans are "ready to go" and the entire IOC container is finished.
2, Javaconfig
The spring framework introduces and continues to refine the description of dependency bindings based on Java code and annotation meta-information , the Javaconfig project.
The dependency binding description based on the Javaconfig method basically maps the oldest XML-based configuration:
Any Java class definition labeled @configuration is a Javaconfig configuration class.
Any method that labels the @bean, whose return value is registered as a bean definition to the spring IOC container, will default to the ID of the bean definition.
If the definition of a bean relies on other beans, it is possible to invoke the creation method of the dependent bean directly in the corresponding Javaconfig class.
Those with high exposure rate: annotation
@ComponentScan, @PropertySource and @propertysources, @Import and @importsource
Third, the working mechanism of Springboot
1. @SpringBootApplication
For Springboot applications, only three annotation are important, and the "three-body" structure actually refers to this three annotation: @Configuration, @EnableAutoConfiguration, @ Componentscan
2, springapplication:springboot program start a one-stop solution
3, springboot application start step Brief
Iv. Understanding the Spring-boot-starter
1. The Springboot micro-framework affects the spring community's developers from two main levels:
(1) The "Contract over configuration (COC)" concept based on the spring framework and the road to best practices;
(2) Spring-boot-starter automatic configuration dependency module for everyday enterprise application development scenarios, so many "out-of-the-box" dependent modules make spring applications for the development of a variety of scenarios faster and more efficient.
2, SPRING-BOOT-STARTER-AOP
The AOP (Aspect oriented programming) scenario on the Java platform has essentially been secured in a way that SPRINGAOP combines ASPECTJ.
3, Spring-boot-starter-actuator
The Spring-boot-starter-actuator Auto-configuration module is used to support monitoring of springboot applications.
Five, Springboot micro-service practice exploration
1. Using Springboot to build micro-services
(1) Creating Springboot microservices based on the Dubbo framework
Dubbo: A high-performance service governance framework based on TCP long-connection communication (Netty).
Dubbo MicroServices are standardized in springboot form, so that we can enjoy a range of research and development support from the Springboot framework and the perimeter, as well as a unified release, deployment, and operation.
One of the characteristics of microservices is that they are numerous.
(2) Quickly build Web APIs with Springboot
2, Springboot micro-Service Release and deployment
Docker-based publishing and deployment methods:
3, Springboot micro-service registration and discovery
4, Springboot micro-service monitoring and operations
From local trigger alarm to system intelligence alarm
In fact, an effective alarm system should be able to systematically comprehensively consider all monitoring levels of data, and then summarize and analyze, and finally issued an effective alarm, known as the systematic intelligent alarm.
5, Springboot micro-service security and protection
Depth defense (defence in Depth)
Access to the authentication and authorization process (authentication and Authorization)
6, Springboot micro-service system backbone: Release and deployment Platform
Summary of knowledge points of Springboot rapid construction of micro-service system