Concurrent programming -- three implementation methods of distributed lock

Understanding of using distributed locks Each distributed lock has its advantages and disadvantages. In extreme cases, such as NPC, there may be wrong results and it is unsafe, as shown in the figure below (both clients think they have obtained the lock), NPC refers to Network Delay; Process Pause, Process Pause (GC) [such as JAVA GC]; Clock ...

Posted by Gump on Sat, 29 Jan 2022 04:59:24 +0100

Intercept the application error log and send it to the nail group | Java development practice

Opening Now all applications need to monitor or alarm the log. Now the common practice is to collect the log by EKL, and then display the content and alarm strategy by Grafana. If the project architecture is relatively simple (single application) and you don't want to rely on so many middleware, here is a simple way to do it~ Inherit Unsynchr ...

Posted by JasperBosch on Fri, 28 Jan 2022 18:36:00 +0100

Kafka fast learning II (producer and consumer development)

Partition policy for producer to send messages 1. Default policy DefaultPartitioner When sending messages, specify the partition with the highest priority When you specify a key when sending a message, the module will be taken according to the hash value of the key The partition and key are not specified when sending the message. Will be ra ...

Posted by Burns on Fri, 28 Jan 2022 12:58:58 +0100

Java Cglib dynamic agent principle source code analysis

Environment: Java 8 Cglib agent usage System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY, "E://cglib"); Enhancer enhancer = new Enhancer() ; enhancer.setSuperclass(PersonDAOImpl.class) ; enhancer.setCallback(new MethodInterceptor() { @Override public Object intercept(Object obj, Method method, Object[] args, MethodProxy pr ...

Posted by Chesso on Fri, 28 Jan 2022 05:51:53 +0100

MIT 6.824 Lab4 AB completion record

explain Detailed implementation ideas and experimental principles are provided here, and most of the code at the skeleton level is provided. Not all codes are provided.Complete code. If you really need it, please send a private letter or leave a message. Overall architecture The overall experimental description of lab4 is very lengthy. We ne ...

Posted by hmiller73 on Thu, 27 Jan 2022 23:46:43 +0100

[Kafka] idempotent implementation of Kafka transactional

1. General Reprint: Idempotent real of Kafka transactional property Starting from 0.11.0, Apache Kafka supports a very large feature, that is, transactional support. In Kafka, transactional has three meanings: one is idempotent support; Second, transactional support; The third is the implementation of exactly once of Kafka Streams. In the a ...

Posted by linux_pickle on Thu, 27 Jan 2022 01:55:35 +0100

Redis is more than just get set. Analysis of eight data types and application scenarios

introduce How many data types does Redis have? (note that the data type is not a data structure) There are eight types in total: String, Hash, Set, List, Zset, Hyperloglog, Geo and Streams. 1. Why put data in memory? Faster memory, 10W QPSReduce computing time and reduce database pressure 2. If the data structure in memory is used as the c ...

Posted by gfX on Wed, 26 Jan 2022 16:49:42 +0100

RocketMQ transaction message principle

1, Principle of RocketMQ transaction message: RocketMQ implements complete transaction messages after version 4.3. The MQ based distributed transaction scheme essentially encapsulates the local message table. The overall process is consistent with the local message table. The only difference is that the local message table is stored in MQ inst ...

Posted by kath421 on Wed, 26 Jan 2022 10:13:26 +0100

Kafka Study Notes

Kafka Study Notes install ellipsis The installation under linux is simply NIMA outrageous zooker. Change it Just open kafka's port Methodology of Kafka operation First, understand what message queuing is. There must be sender and receiver for the transmission of information If the sender and receiver receive messages synchronously, it will ...

Posted by mudi on Wed, 26 Jan 2022 08:16:43 +0100

Nacos of the registry

Nacos of the registry Springcloud + nacos – version selection Before everything starts, you need to confirm all versions, because if the versions do not match, it may lead to many strange problems. 1. Front First confirm the version of Spring Cloud Alibaba from the spring official websiteConfirm the version of Spring Boot and Nacos th ...

Posted by pikymx on Mon, 24 Jan 2022 10:34:25 +0100