Rocket MQ Series II - producer principle

Producer principle Producer overview         The party sending the message is called the producer. His role in the entire RocketMQ production and consumption system is shown in the figure:         Producer group: a logical concept. When using producer instances, you need to specify a group name. A ...

Posted by jayskates on Tue, 16 Nov 2021 07:31:23 -0800

spring cache Basics

Spring has defined org.springframework.cache.Cache and   org.springframework.cache.CacheManager interface to unify different caching technologies; And support the use of   JSR-107   Annotations simplify our development; Provides implementations that support multiple caches. There are two main interfaces: org.springframework. ...

Posted by goodluck4287 on Tue, 16 Nov 2021 07:10:06 -0800

Talk about HashMap 02 of jdk1.8

HashMap capacity expansion mechanism Previous review: Talk about HashMap 01 of jdk1.8 Last time we finished the put method, there was a way I did not elaborate, that is resize() method, which I personally think is the most beautiful but the most difficult part of HashMap. Next we will explain it slowly. Review the member variables transient ...

Posted by ntsf on Tue, 16 Nov 2021 06:11:03 -0800

Constructor and destructor of single inheritance derived class

#include <iostream> #include <cstdio> #include <cmath> #include <climits> #include <iomanip> #include <windows.h>// #include <iostream> #define MAX(x,y) (x)>(y)?(x):(y) #include <string.h> using namespace std; class A { public: A() { a=0; co ...

Posted by blackwidow on Tue, 16 Nov 2021 05:17:43 -0800

An article to understand ThreadLocal

How does ThreadLocal ensure that objects are only accessed by the current thread?Let's dig into the internal implementation of ThreadLocal.Naturally, we need to focus on the set() method and get() method of ThreadLocal.setLet's start with the set() method: /** * Sets the current thread's copy of this thread-local variable * to the ...

Posted by MickeySox on Tue, 16 Nov 2021 04:03:40 -0800

Getting started with JavaEE and Mybatis

1: Introductory case 1: First create a new module = = > set the Java version to 8 = = > find the following components, check and Finish 2: Write the structure as shown in the following figure controller layer UserController class ​ package com.mybatis.mybatis.controller; import com.mybatis.mybatis.entity.User; import com.mybatis ...

Posted by fansa on Tue, 16 Nov 2021 03:49:22 -0800

Chapter 4 request and response

Browser access Servlet process: HttpServletResponse object: It inherits from the ServletResponse interface and is specially used to encapsulate HTTP response messages. It defines the method of sending response status code, response message header and response message body to the client. Methods related to sending status codes include: 1. set ...

Posted by freynolds on Tue, 16 Nov 2021 01:11:34 -0800

Use an ingress controller to get through the dubbo+k8s network

backgroundSince all services in the company run on Alibaba cloud k8s, and the IP reported to the registry by dubbo provider is Pod IP by default, this means that dubbo services cannot be called in the network environment outside the k8s cluster. If local development needs to access dubbo provider services in k8s, it is necessary to manually exp ...

Posted by Lol5916 on Tue, 16 Nov 2021 01:06:16 -0800

7, Web component injection

7, Web component injection 1. Web native component injection (Servlet, Filter, Listener) Method 1: use @ ServletComponentScan + web3.0 annotation Add the ServletComponentScan("") annotation on the main startup class of MainApplicationContext @ServletComponentScan("day01.view") @SpringBootApplication public class MainApplication ...

Posted by samUK on Tue, 16 Nov 2021 00:23:54 -0800

Thoroughly understand the principle of Spring state machine and realize the decoupling of order and logistics

This article is excerpted from "design patterns should be learned this way"1 UML class diagram of state patternThe UML class diagram of the state pattern is shown in the figure below.2. Use the status mode to realize the free switching of login statusWhen we read articles in the community, if we think the articles are well written, we ...

Posted by LucidParody on Tue, 16 Nov 2021 00:17:19 -0800