Fengdi Li | 李锋镝

Detailed explanation of RocketMQ’s push consumption method

Original link: https://www.lifengdi.com/archives/transport/technology/3937 MQ consumption mode Consumption mode refers to how consumers get messages from MQ, which is divided into two modes, push (push mode) and pull (pull mode). 1, push (push method) push, as the name suggests, means to push. That is, when MQ receives the message generated by the producer, it will actively …

Detailed explanation of RocketMQ’s push consumption method Read More »

Lose weight for 4 months

Original link: https://www.lifengdi.com/archives/daily/3935 At the beginning of April this year, I started skipping rope every day to lose weight, and today it is just four months. From the beginning, skipping rope every day for ten minutes to half an hour, then from half an hour to an hour, and finally stabilized at half an hour. …

Lose weight for 4 months Read More »

Today is Tanabata Festival~

Original link: https://www.lifengdi.com/archives/daily/3933 I said that the girls on the street and the company are all dressed up so beautifully and immortal today~~ It turns out that they are all for their sweethearts… Speaking of the Qixi Festival, the Cowherd and Weaver Girl meet once a year, This year is a year on earth… but …

Today is Tanabata Festival~ Read More »

SpringBoot Timing Task – Classic Timing Task Design: Timing Wheel Case and Principle

Original link: https://www.lifengdi.com/archives/transport/3932 Timer and ScheduledExecutorService are JDK built-in timed task solutions, and there is also a classic timed task design in the industry called Timing Wheel. Netty internally implements a HashedWheelTimer based on the time wheel to optimize millions of I/O timeouts. Detection, it is a high-performance, low-cost data structure, which is suitable for …

SpringBoot Timing Task – Classic Timing Task Design: Timing Wheel Case and Principle Read More »

Why do Java serialization and deserialization implement the Serializable interface?

Original link: https://www.lifengdi.com/archives/transport/technology/3931 Serialization and Deserialization Serialization: The process of converting an object into a sequence of bytes is called serialization of an object. Deserialization: The process of restoring a sequence of bytes to an object is called deserialization of an object. When do you need to use What about serialization and deserialization? When we …

Why do Java serialization and deserialization implement the Serializable interface? Read More »

[PostgreSQL 15] Improvements to UNIQUE and NULL in PostgreSQL 15

Original link: https://www.lifengdi.com/archives/transport/technology/3917 To sum up this improvement in one sentence: Support unique constraints and indexes treat null values ​​as the same value. Instead of indexing null values ​​into distinct values, you can now treat null values ​​as the same value by creating a constraint using unique nulls not distinct. Create an example table in …

[PostgreSQL 15] Improvements to UNIQUE and NULL in PostgreSQL 15 Read More »

Characters and Strings in Java

Original link: https://www.lifengdi.com/archives/course/java/3913 In Java, characters and strings are two different types. Character type The character type char is a basic data type, which is an abbreviation for character. A char holds a Unicode character: char c1 = ‘A’; char c2 = ‘中’; Because Java always uses Unicode to represent characters in memory, an English …

Characters and Strings in Java Read More »

Java Boolean Operations

Original link: https://www.lifengdi.com/archives/course/java/3912 For the boolean type boolean, there are always only two values, true and false. A Boolean operation is a relational operation and includes the following categories: Comparison operators: >, >=, <, <=, ==, != AND && OR || NOT! Here are some examples: boolean isGreater = 5 > 3; // true int …

Java Boolean Operations Read More »

Time to say goodbye to NullPointException gracefully

Original link: https://www.lifengdi.com/archives/transport/technology/3910 NullPointException should be a guy familiar to every coder, right? Whose code didn’t throw a few null pointer exceptions… For example: you wrote the following code: public void getCompanyFromEmployee() { Employee employee = getEmployee(); Company company = employee.getTeam().getDepartment().getCompany (); System.out.println(company); } private Employee […] This article is reproduced from: https://www.lifengdi.com/archives/transport/technology/3910 This site …

Time to say goodbye to NullPointException gracefully Read More »

Java floating point arithmetic

Original link: https://www.lifengdi.com/archives/course/java/3909 Compared with integer operations, floating-point number operations can only perform numerical calculations such as addition, subtraction, multiplication and division, and cannot perform bit operations and shift operations. In computers, although floating-point numbers have a large range of representation, floating-point numbers have a very important feature, that is, floating-point numbers often cannot be …

Java floating point arithmetic Read More »

Java Integer Operations

Original link: https://www.lifengdi.com/archives/course/java/3908 Java’s integer operations follow four arithmetic rules and can use any nested parentheses. The four arithmetic rules are the same as those of elementary mathematics. For example: // Four arithmetic public class Main { public static void main(String[] args) { int i = (100 + 200) * (99 – 88); // 3300 …

Java Integer Operations Read More »