[Java] Sort Java objects

How to sort Java objects object order Direct comparison leads to ClassCastException import lombok.AllArgsConstructor; import lombok.Data; import java.util.*; /** * @author niushuai * @date 2019/9/18 10:17 */ public class CompareDemo { public static void main(String[] args) { Student s1 = new Student("Zhang three 1", 13); ...

Posted by csimms on Wed, 18 Sep 2019 06:08:38 +0200

Service Fault Tolerant Component of Spring Cloud Alibaba - Sentinel [Code]

Communication Principle between Sentinel and Control Station stay Basic Chapter We learned how to integrate Sentinel for the project, and built a visual console for Sentinel. We introduced and demonstrated various rules configuration methods supported by Sentinel. Sentinel is further introduced in this paper. First, let's see how the console c ...

Posted by megosh on Fri, 02 Aug 2019 10:14:15 +0200

Spring CloudFeign transfers date type parameters with a time difference of 14 hours

I. Time difference of Java Date type Look at the code below. public static void main(String[] args) throws Exception { Date date1 = new Date(); System.out.println("date1: " + date1.toString()); Date date2 = new Date(date1.toString()); System.out.println("date2: " + date2.toString()); } The results are as follows. date1: ...

Posted by timvw on Mon, 22 Jul 2019 05:50:49 +0200

SpringBoot Unified Response Body Solution

Preface Recently, before optimizing itself, the implementation scheme of unified responder based on Spring AOP is proposed. What is a unified responder? In the current front-end and back-end separation architecture, the back-end is mainly a RESTful API data interface. However, the number of HTTP status codes is limited, and with the growth of b ...

Posted by EternalSorrow on Thu, 18 Jul 2019 04:26:01 +0200

Three Reactor Models Based on NIO

Traditional bio-blocked io transmission is inefficient because it needs to wait for queuing every time data is transmitted. with the development of jdk step by step, nio non-blocking technology is becoming more and more popular.   What is Reactor Reactor can be understood as reactor mode. When a subject changes, all depend ...

Posted by Grisu on Sun, 12 May 2019 12:02:33 +0200

Interceptor and three components for Springboot series Spring Boot web development

1. Interceptors image The Interceptor interceptor in Springboot, also known as the interceptor in mvc, omits the xml configuration section.There is no essential difference, all through the implementation of several methods in HandlerInterceptor.The functions of several methods are listed below. preHandle Executed before en ...

Posted by itsjames on Sat, 11 May 2019 06:03:36 +0200