Manually implement thread pool in Java

1. Why use thread pool? In the previous article, we created a thread when using threads, which is very easy to implement, but there will be a problem: if there are a large number of concurrent threads and each thread executes a task for a short time, the frequent creation of threads will greatly reduce the efficiency of the system, Because it ...

Added by guidance on Wed, 15 Dec 2021 00:35:38 +0200

RabbitMQ: use Docker to build RabbitMQ high availability load balancing cluster

catalogue 1, Building a RabbitMQ cluster 1. Start multiple RabbitMQ nodes 2. Join the cluster 3. Configure the image queue 2, HAProxy load balancing 1. Install HAProxy 2. Configure HAProxy 3. Start 3, KeepAlived configuration High Availability 1. KeepAlived installation 2. KeepAlived configuration Use Docker to build a RabbitMQ clu ...

Added by member123 on Mon, 13 Dec 2021 11:16:06 +0200

RabbitMq point-to-point mode communication (front end reception)

3.RabbitMq point-to-point (Direct) mode communication The point-to-point mode adopts the direct connection switch, which is delivered to the corresponding queue according to the routing key carried by the message. To create the Spring Boot Configuration class used here, first create a directrabbitconfig Configuration class. The Configuratio ...

Added by jane on Sun, 12 Dec 2021 13:12:46 +0200

RabbitMQ retry mechanism

The consumer may report an error during message processing. How to reprocess the message? There are two solutions. Record the number of retries in redis or database. After the maximum number of retries is reached, the messages enter the dead letter queue or other queues, and then process these messages separately; Use the retry function i ...

Added by daddymac on Wed, 08 Dec 2021 07:29:39 +0200

rabbitMq implements delay queue

Business scenario: 1. If the order is not paid for 30 minutes, it will be automatically cancelled. How can we achieve this? 2. Send a text message to the user 60 seconds after the order is generated 1 install rabbitMq windows installer Installed in ubuntu 2 add maven dependency <!-- https://mvnrepository.com/artifact/org.sprin ...

Added by badre on Tue, 07 Dec 2021 12:00:42 +0200

Python's Flask routing and blueprint

1. Routing @app.route('/index') def index(): return "hello world" 1.1 query routing information Command line mode Note: at least flag must be specified_ App environment variables >flask routes Endpoint Methods Rule -------- ------- ----------------------- index GET /index static GET /static/<path:filena ...

Added by auamy on Tue, 30 Nov 2021 12:11:48 +0200

RabbitMQ video learning (basic)

RabbitMQ video learning (basic) Based on Alibaba cloud, this article refers to the videos of Shang Silicon Valley: Shangsilicon Valley 2021 new RabbitMQ tutorial | quickly master MQ message middleware 1. Related concepts of MQ 1.1. What is MQ? MQ (Message Queue), literally speaking, is essentially a queue. FIFO is first in first out, but th ...

Added by ironman32 on Thu, 11 Nov 2021 13:18:22 +0200

RabbitMQ message queue

RabbitMQ Message Queuing Middleware Install directly on Linux Start service systemctl start rabbitmq-server View service status systemctl status rabbitmq-server Out of Service systemctl stop rabbitmq-server Startup service systemctl enable rabbitmq-server 1, Introduction to message queue 1. Synchronous call and async ...

Added by MartinGr on Thu, 04 Nov 2021 07:01:04 +0200

Docker builds RabbitMQ cluster Nginx+Keepalived high availability

Single nginx agent + mirror queue Pull image # Pull image docker pull rabbitmq:3.8.7-management # Create mount directory mkdir -p /data/rabbitmqcluster/{rabbitmq01,rabbitmq02,rabbitmq03} Create container # first docker run -d --hostname rabbitmq01 --restart=always --name rabbitmqCluster01 -v /data/rabbitmqcluster/rabbitmq01:/var/lib/r ...

Added by and1c on Mon, 01 Nov 2021 19:26:55 +0200

Delay queue and dead letter queue of rabbitmq

1, Delay queue and dead letter queue Dead letter queue: elements are not consumed in time after they are generated and are always stored in the queue. Delay queue: the delay queue has a sequence within the queue. Its most important feature is the delay time. It wants to be taken out and processed after or before the specified time. It is simi ...

Added by Riotblade on Mon, 01 Nov 2021 03:35:07 +0200