Asynchronous callback issues of fastAdmin payment plug-in, handling concurrent notifications

Recently, FastAdmin’s payment plug-in was used to develop a PC-side function for scanning QR codes to recharge the balance. After successfully recharging, I encountered the problem that the WeChat server sent asynchronous callback notifications multiple times and my data was modified multiple times. I responded according to the callback in the FastAdmin payment plug-in, //The […]

MySQL implements data synchronization (producer) and stores data in Redis (SpringBoot)

Dependencies: In addition to the following two, there are also mybatisplus, MySQL, and lombok <!– This dependency is to monitor MySQL data changes –> <dependency> <groupId>com.zendesk</groupId> <artifactId>mysql-binlog-connector-java</artifactId> <version>0.27.1</version> <!–Version 2022.09.17–> </dependency> <!– Create a SpringBoot project and add the redis starter dependency –> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> Implementation idea: All data in the synchronized database […]

Linux driver development——– Kernel synchronization and mutual exclusion

Interview: Please tell me, what are the synchronization methods between threads? Multiple threads in the same process share the same address space. In order to avoid the confusion caused by multiple threads accessing data at the same time, it is necessary to consider the synchronization problem between threads. The so-called synchronization refers to collaborative pace […]

Asynchronously calling RESTful interface based on okhttp3 and CompletableFuture

Application scenarios When the server program provides a set of RESTful interfaces for third-party calls, it often needs to provide the other party with an SDK. At this time, if you simply use the okhttp3 client to encapsulate the calls, when the request volume is large, request blocking will often occur and the JVM memory […]

Multi-threaded JUC Season 2 synchronized lock upgrade process

An overview of synchronized 1.1 Features of synchronized Using locks can achieve data security, but it will cause performance degradation. Synchronized is a heavyweight lock, and the lock upgrade process is:No lock -> Biased lock -> Lightweight lock -> Heavyweight lock. When concurrency is high, synchronization calls should try to consider the performance loss of […]

SpringBoot-thread pool ThreadPoolExecutor asynchronous processing (including split collection tool class)

ThreadPoolExecutor VS ThreadPoolTaskExecutor ThreadPoolTaskExecutor encapsulates ThreadPoolExecutor. Configuration file application.yml # Asynchronous thread configuration custom usage parameters async: executor: thread: core_pool_size: 10 max_pool_size: 100 # Configure the maximum number of threads queue_capacity: 99988 # Configure queue size keep_alive_seconds: 20 #Set the thread idle waiting time seconds name: prefix: async-thread- # Configure the name prefix of threads […]

Netty core principles: 2. Intermediate extension-07: Netty request and response synchronous communication

Article directory 1. Introduction 2. Code implementation 2.0 Introduce dependencies 2.1 Engineering structure 2.2 RPC codec 2.2.1 Serialization tool class 2.2.2 RPC decoder 2.2.3 RPC encoder 2.3 Writing interface and its implementation 2.3.1 Write interface MAP 2.3.2 Writing interface 2.3.3 Locked writing interface implementation class 2.3.4 Writing class 2.4 Request and response objects 2.4.1 Request […]

Using LinuxPTP for time synchronization (software/hardware timestamp) – Yanyi

Reprinted from: https://blog.csdn.net/BUPTOctopus/article/details/86246335 Official documentation: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s1-using_ptp Check whether the network card supports software and hardware timestamps: sudo ethtool -T eno1 Time stamping parameters for eno1: Capabilities: hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE) software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE) hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE) software-receive (SOF_TIMESTAMPING_RX_SOFTWARE) software-system-clock (SOF_TIMESTAMPING_SOFTWARE) hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE) PTP Hardware Clock: 0 Hardware Transmit Timestamp Modes: off (HWTSTAMP_TX_OFF) on (HWTSTAMP_TX_ON) Hardware Receive Filter Modes: none […]

[Comprehensive explanation of Linux commands] 130.rsync: Fast remote data synchronization tool

Article directory rsync Additional information grammar Options Example SSH mode Backend service mode Learn `python` from scratch rsync Remote data synchronization tool Supplementary instructions The rsync command is a remote data synchronization tool that can quickly synchronize files between multiple hosts through LAN/WAN. rsync uses the so-called “rsync algorithm” to synchronize files between the local […]