rabbitmq switch related example code

1. Sector switch Define sector switches and queues package com.macro.mall.portal.config; import org.springframework.amqp.core.Binding; import org.springframework.amqp.core.BindingBuilder; import org.springframework.amqp.core.FanoutExchange; import org.springframework.amqp.core.Queue; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * Sector switch test */ @Configuration public class RabbitMqFanoutQueueConfig { //==================== In fanout mode, the messages sent belong to broadcast mode================== == /** * Define queue fanout.a fanout.b fanout.c */ @Bean public […]

nodejs operates rabbitMQ amqplib library message persistence

config.js const { MQ_HOST, HOST, MQ_PORT } = process.env; const mqHost = MQ_HOST || HOST || “127.0.0.1”; const mqPort = MQ_PORT || 5672; const mqUsername = “root”; const mqPassword = “password”; const mqProtocol = “amqp”; const exchangeName = ‘exchange_direct_saas’; //switch const queueName = ‘queue_direct_saas’; const routingKey = ‘saasIsolution’;//routing key const config = { mqHost, mqPort, […]

[RabbitMQ] RabbitMQ message accumulation problem – use lazy queue to solve the message accumulation problem

Article directory 1. Message accumulation problem 1.1 What is the message accumulation problem? 1.2 Solutions to message accumulation 2. Lazy queue solves message accumulation problem 2.1 The difference between lazy queue and ordinary queue 2.2 How to declare lazy queue 2.3 Demonstrate lazy queue receiving a large number of messages 2.4 Advantages and disadvantages of […]

An in-depth introduction to RabbitMQ: sequential consumption, dead letter queue and delay queue

1. RabbitMQ 1.1 Core Components RabbitMQ is an open source message middleware that implements the Advanced Message Queuing Protocol (AMQP) and provides various important components to support the production, transmission and consumption of messages. Producer: The producer is the sender of messages and is responsible for publishing messages to the RabbitMQ server. Messages can contain […]

RabbitMQ’s message loss, message duplication, and message backlog issues

In the previous article, I introduced the development plan of RabbitMQ to achieve distributed final consistency. This article will solve some problems in this plan. http://t.csdnimg.cn/aOYTH First, the three major problems of RabbitMQ: message loss, message duplication, and message backlog The most serious of these three problems is the problem of message loss. Then let […]

SpringCloud integrates WebSocket and rabbitMQ

Article Directory summary Overall architecture process Explanation of technical terms technical details summary Summary Requirement goal: In the springcloud project, realize real-time refresh of high-frequency simple data to the API externally. Goal achieved: 1. Lightweight data can be refreshed in real time using WebSocket. The configuration is simple and easy to use. If the data […]

Implementing eventually consistent distributed transactions for placing orders and reducing inventory based on RabbitMQ

The National Day holiday really gave me a break, and the update progress was slow. Now that the status has finally been adjusted back, continue to update. Without further ado, let me show you the overall data flow diagram. Text Interpretation Step 1: The user places an order and calls the order service. We directly […]

Android application integration RabbitMQ message processing guide

Android application integration RabbitMQ message processing guide RabbitMQ 1 Introduction 2. Introduction to RabbitMQ 2.1. What is RabbitMQ? 2.2. Features of RabbitMQ 2.3. Working principle of RabbitMQ 2.4. Several important concepts in RabbitMQ 3. Integrate RabbitMQ in Android Studio 3.1. Add permissions in Manifest: 3.2. Add dependencies under build.gradle(:app): 4. Establish connection 4.1. Create ConnectionFactory […]

How does RabbitMQ implement a delay queue?

Delay queue means that after a message is sent, it is not executed immediately, but waits for a specific time before the consumer executes the message. The usage scenarios of delay queue include the following: Orders not paid on time will be canceled after 30 minutes expires. Push messages to users with low activity after […]