Break it! What's new in Spring Boot 2.3.0: how to stop gracefully?

1. What is elegant shutdown Let's start with a simple code, as follows: @RestController public class DemoController {  @GetMapping("/demo")  public String demo() throws InterruptedException {      //Simulate business time-consuming processing flow   Thread.sleep(20 * 1000L);   return "hello";  } } When we request the traffic to execute the busi ...

Posted on Fri, 29 May 2020 04:47:24 -0400 by jaylee

Spring Boot 2.3 gracefully closes the new pose, which is really fragrant!

The latest Spring Boot 2.3 is almost half a month old: https://spring.io/blog/2020/05/15/spring-boot-2-3-0-available-now One of the new features is: Graceful shutdown I've shared such articles before, but now I've even produced the official gesture. For the new function, I have to go to the official for a look. Here's the official description ...

Posted on Thu, 28 May 2020 23:47:37 -0400 by dr4296

What's new: how can Spring Boot 2.3.0 stop gracefully?

Original text: https://mp.weixin.qq.com/s/uvNkdcmwkd6lcSRDhjPUJQ   1. What is elegant shutdown Let's start with a simple piece of code,As follows: @RestControllerpublic class DemoController { @GetMapping("/demo") public String demo() throws InterruptedException {     //Simulate the time-consuming process of business  Thread.sleep(20 * 1000 ...

Posted on Sun, 24 May 2020 06:27:31 -0400 by thebopps

Analysis of thread isolation

preface With the popularity of microservices, single applications are divided into independent microprocesses. A simple request may require multiple microservices to process together, which in fact increases the probability of error. Therefore, how to ensure that when a single microservice fails, the negative impact on the whole system is mini ...

Posted on Mon, 18 May 2020 02:17:58 -0400 by psytae

Observer model of behavior model

1 General Observer pattern, also known as publish subscribe pattern, is a very important behavior pattern. It is widely used in asynchronous programming, which can be said to be the basis of asynchronous programming. 2 observer mode When we need to pay attention to the state of an object, we can constantly poll to see whether the state changes, ...

Posted on Sun, 10 May 2020 08:55:09 -0400 by Visualant

Heartbeat design of Dubbo analysis

Preface When it comes to RPC, TCP communication can't be bypassed, and the mainstream RPC frameworks all rely on communication frameworks such as Netty. At this time, we need to consider whether to use long connection or short connection: Short connection: the connection is closed after each communication, and the connection needs to be re c ...

Posted on Sat, 09 May 2020 03:54:32 -0400 by bradles

The experience of accessing native APNS in a job

scene The company's products mainly interact with the intelligent hardware on the APP side, involving the push of hardware alarm and status, which must be delivered to the user in real time. At the beginning, we chose the integrated Aurora push free version, and the effect can also be achieved, but on the 4th-1st, the aurora server crashed in t ...

Posted on Thu, 07 May 2020 23:00:42 -0400 by wwfc_barmy_army

Implementing rpc framework-spring boot client based on netty

The last section describes the implementation of RPC server.The principle is to parse the netty channel data to get information such as classes, methods and parameters, and then call the local interface through the java reflection mechanism to return the results.No sophisticated technology was used. This is our client implementation.The client' ...

Posted on Wed, 22 Apr 2020 22:45:48 -0400 by moberemk

Implementation of rpc framework spring boot server based on netty

demo address https://gitee.com/syher/grave-netty   RPC introduction First, take a look at RPC: remote procedure calls. Simply put, the local application can call the interface of the remote server. So how to call the remote interface? To put it bluntly, RPC is just a concept. His call can be implemented based on HTTP or TCP/IP. Even custom comm ...

Posted on Wed, 22 Apr 2020 05:44:53 -0400 by czukoman20

Hard core!Summary of the most complete delayed task implementation ever!Code attached (highly recommended)

How do I delay tasks? In a nutshell, go directly to today's topic. The main content of this article is as follows: What are delayed tasks? Considerably, tasks that need to be delayed are called delayed tasks. The usage scenarios for delaying tasks are as follows: The red envelope has not been checked for 24 hours and needs to be delayed in ...

Posted on Fri, 17 Apr 2020 18:11:56 -0400 by TheSeeker