background

The problem starts with a cup of coffee.

Today, I went downstairs to the coffee machine and bought a “pink Latte”. Production process display:

I took a ready-made pink latte, took a sip, and sure enough, it was a hot chocolate. Hey, hey, hey, hey, where’s the latte? Although I have a high opinion of the a la Carte coffee, I think it tastes as good as Papa Star. But there’s no denying it did give me a fake latte.

Many technologists today are like coffee experts. They don’t need to know the difference between coffee beans and cacao beans, let alone what the two plants look like on a tree. It doesn’t matter, it doesn’t stop them from telling the difference between a latte, a mocha or a cappuccino. For example, in the case of team cooperation at work, they don’t need to know how other teams’ products are realized, they just need to ask them to help solve problems when they have problems. As a result, many jobs now require good communication and motivation skills for senior positions. Technical ability is examined in less detail.

But as a technician, it’s important to know what’s underneath. Because we don’t buy coffee, we make coffee machines. One day, the coffee machine didn’t work. After analyzing the monitoring alarm and big log data, we finally found the reason: a coffee bean was too small and stuck in the groove. After cleaning the coffee beans, the coffee machine is back in working order. Is this the end of it?

No, we need to go back and use 5Why analysis to find the root cause of the problem.

Q: Why doesn’t the coffee machine work?

A: Because A coffee bean got stuck in the groove.

Q: Why is it stuck in the groove?

A: Because the coffee bean was too small, it fell off.

Q: Why do they fall when they are too small?

A: Because the beans are basically round, there is A lot of space between the beans and there is no pressure on each other. It was just gravity, and it fell.

Q: Why are all beans round? Can’t you make square beans that fit tightly together?

It’s time to regret not knowing what kind of tree the coffee beans grow on. Without understanding, there is no way to make reasonable changes.

Now we all like to use SpringBoot. Normally working well, suddenly the company requires to do a basic component upgrade, yi Yi yi, local running well. Publishing to the server does not run. The guy who built the basic framework of development had already left the company. Is he looking at the pile of logs in a daze? Or do you want to understand the basic concepts and follow through? So much for the nonsense.

concept

What is SpringBoot?

SpringBoot is a framework and programming specification. It simplifies the use of many frameworks and components, one-stop file configuration and application deployment. Because it has a built-in server and startup class code, it can quickly open a Web container.

What is a Web container?

A Web container is an application that can handle requests from a client. In the server, a port corresponds to a program that provides the corresponding service. In Java terms, a Web server generally refers to a Servlet container.

What is a Servlet?

A Servlet is just an interface. It declares three basic methods for the Servlet lifecycle: init(), service(), and destroy(). The Web container calls these methods at certain times. Servlets provide a standard and are one of the 13 standard interface specifications for J2EE.

What is J2EE?

J2EE(Java 2 Platfrom, Enterprise Edition) was originally a Java platform designed for similar computing at the mainframe level in large enterprises. This standard provides the ground for components that provide reusable module components. It’s defining a set of interfaces on top of which you’re going to implement everything. The Java2 platform includes standard edition (J2SE), enterprise edition (J2EE), and miniature edition (J2ME).

What is the Java2 platform?

When Sun released JDK1.2 in 1998, it used the new name Java 2 Platform. The modified JDK became Java 2 Platfrom Software Developing Kit, or J2SDK.

The relationship between Web containers and Netty

Web containers (such as Tomcat and Jetty) mainly process messages from clients and distribute them to worker threads for processing. Worker threads do what they do through servlets. The coordination and communication between the receiving message thread and worker thread is now mainly done by Netty.

Here’s an overview of their relationship:

conclusion

If you find this article helpful, please do not hesitate to give me a thumbs-up. Your support is the biggest encouragement for me. For more Java basics and interview answers, go to GitHub:Github.com/Java-Sober/…