Practice RabbitMQ’s producer reliability implementation on Idea

Producer reliability implementation Article directory Producer reliability implementation Preface producer reliability Foreword When sending a message we may have thought that the message might be discarded. Starting from front to back according to the message transfer process, we start with the producer. It is possible for a producer to lose a message while sending it. […]

Operating System – The most detailed explanation of the classic synchronization problem (Series 1 – Consumer Producer Problem)

Directory: 1. Producer and consumer issues (1) Single producer, consumer (2) Multiple producers and consumers (3) Practice questions Producer and consumer issues are often the focus of exams, so mastering this issue is critical. This article will focus on typical producer and consumer problems from simple to difficult, from easy to deep. Finally, we provide […]

[Linux] Producer and consumer model

producer and consumer concept Producer-consumer model based on BlockingQueue All code Producer and consumer concepts The producer-consumer pattern solves the strong coupling problem between producers and consumers through a container. Producers and consumers do not communicate directly with each other, but communicate through this container. Therefore, after the producer produces the data, it does not […]

Blocking queue-producer-consumer model

Introduction to blocking queue Standard library blocking queue usage Simple producer-consumer model based on blocking queues. Implement a simple blocking queue (based on array implementation) Introduction to blocking queue Don’t confuse it with the ready queue that we learned about multi-threading before; Blocking queue: It is also a queue, first in first out. With special […]

Process (daemon process–mutex lock–IPC mechanism–producer model–zombie process and orphan process–simulated ticket grabbing–message queue)…

Table of contents 1: Process theoretical knowledge 1.Theoretical knowledge 2: What is a process? Three: Zombie processes and orphan processes 1. Zombie process Four: Daemon process 1. What is a daemon process? 2. The main process creates a daemon process 3.Daemon process Five: Mutex lock (simulating multi-person ticket grabbing) 1.What is a lock? 2. What […]

[RabbitMQ Practical Combat] 03 SpringBoot RabbitMQ producer and consumer examples

In the previous section, we wrote an example of native API for production and consumption. In fact, SpringBoot has re-encapsulated the native RabbitMQ client, making it cheaper for us to use the API. 1. Configuration file Dependency introduction <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId></groupId> <artifactId>gson</artifactId> <version>2.8.6</version> </dependency> </dependencies> The configuration […]

mqtt-2. Message producer

Consumer Environment 1. Introduce maven dependencies <!–mqtt related dependencies start –> <!–The following must exist –> <dependency> <groupId>org.springframework.integration</groupId> <artifactId>spring-integration-core</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-integration</artifactId> </dependency> <dependency> <groupId>org.springframework.integration</groupId> <artifactId>spring-integration-stream</artifactId> </dependency> <dependency> <groupId>org.springframework.integration</groupId> <artifactId>spring-integration-mqtt</artifactId> </dependency> <!–mqtt related dependencies end –> </dependencies> Define configuration class to connect to mqtt server and define channel package com.mengmeng.mqtt.emqtt.config; import org.eclipse.paho.client.mqttv3.MqttConnectOptions; import org.springframework.beans.factory.annotation.Value; […]

Kakfa – Producer mechanism principle and optimization

Producer is the producer component in the Kakfa model, which is the production source of data in the Kafka architecture. Although it is a relatively simple component as a whole, there are still many details that need to be scrutinized. For example, what is the implementation principle of Kafka’s Producer and how to send messages? […]

Traditional producer and consumer problems, Sychronized version and Lock version

1. Synchronized version of producer and consumer issues Interview: Singleton pattern, sorting algorithm, producer consumer, deadlock package com.kuang.pc; /** * Communication issues between threads, producer and consumer issues! Waiting to wake up, notification to wake up * Threads alternately execute A and B to operate the same variable num=0 * A num + 1; *Bnum-1; […]