Spring Boot 2 practice: customize the startup and operation logic

1. Preface I don't know if you have received this kind of demand, and immediately implement some logic after the project is started. For example, cache preheating, or broadcasting after online, etc. Maybe not now but in the future. Think about your possible operation, write an interface and go online. Can I adjust it once? NO! NO! NO! This kin ...

Posted by russ8 on Sun, 03 Nov 2019 05:11:57 +0100

Spring boot exception handling unified encapsulation

brief introduction I'll write the repetition function. In the spring boot project, there are global exception handling and return packaging. The return front end is to bring fields such as succ, code, msg and data. It's easy to solve in the case of a single project. When there are many micro service modules, in many cases, the development is to ...

Posted by neomhm on Sat, 02 Nov 2019 16:58:13 +0100

websocket simple implementation based on springboot

1. Create a new springboot project and add a maven dependency <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> The file directory structure is as follows: 2. Create websocket server c ...

Posted by norbie on Tue, 29 Oct 2019 18:03:49 +0100

About using java+springboot+jfreeChart to make line graph

For reference: https://blog.csdn.net/qq263229365/article/details/9089975 I refer to the author's, maybe because I want to do it with springboot + thmmeleaf, so some codes are different, so I wrote this text, hoping to be useful to you. Step 1: Guide Package In springboot, you only need to add the < ...

Posted by flash_78 on Mon, 28 Oct 2019 15:52:12 +0100

Using SpringBoot RestTemplate to implement third-party interface docking

To implement the docking of third-party interfaces, you can use httpclient (older) or SpringBoot RestTemplate (new generation). You can choose an appropriate way for docking according to your preferences. I recommend using SpringBoot RestTemplate. The specific use is as follows: Custom configuration c ...

Posted by mc2007 on Sun, 27 Oct 2019 11:58:32 +0100

Java application configuring container health check in docker environment

stay Fast experience docker container health This article has experienced the health check function of docker container. Today, we will add health check to the container of java application, so that the application status can be monitored and viewed at any time. Actual combat environment information Operating system: macOS Catalina 10.15 Dock ...

Posted by rob.weaver on Mon, 21 Oct 2019 12:40:44 +0200

[SpringBoot] cross domain, filter and swaggerUI configuration

1. springboot WebAppConfig configuration /**  * Created with IntelliJ IDEA.  *  * @author: zhangenke @Date: 2018/8/16 on 2:25 p.m.  * @description: Let springBoot know that there is this interceptor  */ @Slf4j @Configuration public class WebAppConfig extends WebMvcConfigurationSupport {   // The fol ...

Posted by mrgrammar on Tue, 15 Oct 2019 21:45:23 +0200

Using alicloud ACM configuration center in Springboot

When our project is just a simple Springboot project, it is inconvenient to use Aliyun ACM configuration center to load and read remote database or redis configuration information when Springboot starts. Official sdk packages either need Spring Cloud or just come out of nocos as registries; so they can only be self-reliant. Realization principl ...

Posted by murdocsvan on Tue, 15 Oct 2019 03:56:58 +0200

Spring Boot WebFlux add, delete, modify and query the complete practical demo

03: WebFlux Web CRUD Practice Preface The last article created a simple service based on functional endpoints and implemented Hello. This article uses Spring Boot WebFlux annotation control layer technology to create a CRUD WebFlux application to make development more convenient. We don't access database storage here, because we'll talk about i ...

Posted by coldfission on Mon, 14 Oct 2019 21:09:35 +0200

Tamping Java Foundation Series 11: Deep Understanding of Callback Mechanisms in Java

Catalog Calls between modules Callback in multithreading Java callback mechanism in practice Example 1: Synchronized invocation Example two: from shallow to deep Example 3: Tom does the problem Reference articles Public address Java Technology Personal Public ...

Posted by fcaserio on Wed, 09 Oct 2019 16:37:59 +0200