Auto configuration of spring boot
Spring boot auto configuration is mainly completed by @ EnableAutoConfiguration, @ Conditional, @ EnableConfigurationProperties or @ ConfigurationProperties.@EnableAutoConfiguration enables automatic configuration. Its main function is to call loadFactoryNames() in the spring core package to load the written automatic configuration in th ...
Posted by StateGuy on Fri, 20 Mar 2020 11:02:12 -0700
Interface current limit read this one is enough!!!
Guide reading
A few days ago, I discussed with a friend about their company's system problems, traditional single application and cluster deployment. He said that there might be a risk of instantaneous increase in the concurrent volume of services in the near future. Although the cluster is deployed, the request delay is still very large after ...
Posted by PHP Newb on Fri, 20 Mar 2020 05:58:58 -0700
Three Uses and Source Interpretation of Spring Import
_Recent reviews of Spring Cloud-related sources have added enable s to each new starter, such as: @EnableDiscoveryClient, which registers applications with Eureka Server and pulls services owned by Eureka Server into a micro-service system.Click on the EnableDiscoveryClient source code and you will find the @import annotation inside.The ...
Posted by thomashw on Thu, 19 Mar 2020 17:55:50 -0700
[Spring Security + OAuth2 + JWT introduction to actual combat] 22. Transformation of social login
brief introduction
SDK is generally provided for APP social login. There are two situations for SDK
First kind
SDK provider returns openId and logs in to our interface system with openId to apply for token
Create the OpenIdAuthenticationToken class:
/**
*
*/
package com.spring.security.social.openid;
import java.util.Collection ...
Posted by pinhead on Thu, 19 Mar 2020 11:07:48 -0700
Several ways to create threads in java
brief introduction
Creating threads is the most basic operation in multithreaded programming
1. Inherit Thread class and override run() method
public class CreatingThread01 extends Thread {
@Override
public void run() {
System.out.println(getName() + " is running");
}
public static void main(String[] args) {
new ...
Posted by SN1P3R_85 on Thu, 19 Mar 2020 02:02:52 -0700
Do you really understand that Spring solves circular dependency?
Guide reading
Articles published the other day Spring boot multi data source dynamic switch and Spring boot: a huge pit for integrating multiple data sources In, it is mentioned that adding @ Primary interface to dynamic data source will cause circular dependency exception, as shown in the following figure:
This is a typical constructor dep ...
Posted by luuney on Wed, 18 Mar 2020 09:11:07 -0700
[Spring Security + OAuth2 + JWT entry to actual combat] 20. Password modification login returns standard oauth2 message
brief introduction
Before modification, password login returns standard OAuth2 login success message
Technological process
Refer to this process to generate a token in the login success processor HkAuthenticationSuccessHandler and return:
This is a successful processor copied from the previous browser project. We need to install the abov ...
Posted by Maknis on Wed, 18 Mar 2020 09:05:42 -0700
Integrating SpringBootAdmin and Nacos and SpringSecurity
Preface
It is agreed as follows:
SpringBootAdmin - SBA
SpringSecurity - SSE
According to the current situation of search engine retrieval, everyone's application of SBA is relatively limited, with few divergent use. It is basically based on the example given on the official website (eureka-SBA-SSE),
In addition, there are some confusing probl ...
Posted by stevel on Wed, 18 Mar 2020 08:30:50 -0700
Spring cloud uses Feign and Hystrix to realize fault-tolerant protection of services
@[toc]
Spring cloud uses Feign and Hystrix to realize fault-tolerant protection of services
Preface
The fault-tolerant protection of Hystrix enables the code to be spliced with the + sign when it is called. The implementation method is not elegant, as shown in the figure below.
Hystrix calls service
@HystrixCommand(fallbackMethod = "fallbac ...
Posted by kam_uoc on Wed, 18 Mar 2020 05:33:26 -0700
Spring cloud uses Ribbon to achieve client load balancing
@[toc]
Spring cloud uses Ribbon to achieve client load balancing
Preface
In Spring cloud, when multiple services of the same type start to register in the service registry, the frequency service is the cluster
When the consumer (client) consumes, it needs to select and call the service.
Service registration click
The default call in Spring clo ...
Posted by CreativeWebDsign on Wed, 18 Mar 2020 05:08:16 -0700