# 1. Message middleware
Message queue technology is a technology for exchanging information between distributed applications. Message queues can reside in memory or on disk, and the queue stores messages until they are read by the application. With message queues, applications can execute independently - they do not need to know each other's location or wait for the receiving program to receive the message before continuing. In general, message middleware has the following functions: reducing coupling, reducing traffic peaks, asynchronous communication, and reliable transmission1. Reduce coupling: loose coupling through publish and subscribe Let’s take the registration business as an example. If the registration is successful, SMS and email will be sent to the user for confirmation. The traditional architecture model is as follows:2. Message middleware model
##3. Commonly used message middleware##RabbitMQ
1. RabbitMQ features:
RabbitMQ is a An open source implementation based on the AMQP standard developed in the Erlang language. RabbitMQ originally originated from financial systems and is used to store and forward messages in distributed systems. It performs well in terms of ease of use, scalability, and high availability. Its specific features include:ReliabilityFlexible routingSupport message cluster
High availability
Support multiple protocols (in addition to supporting AMQP protocol, it also supports other message queue protocols through plug-ins, such as STOMP and MQTT)
Support multi-language clients
Provide management interface
Provide tracking mechanism
Provide plug-in mechanism (RabbitMQ provides many plug-ins, and you can also write your own plug-ins)
Summary:
The biggest advantage of RabbitMQ is that it provides a relatively flexible message routing strategy, high availability, reliability, rich plug-ins, multiple platform support and complete documentation. However, due to the AMQP protocol itself, its implementation is relatively heavy, which puts its throughput at a disadvantage compared with other MQs (such as Kafka).
ActiveMQ
1.ActiveMQ Features:
ActiveMQ is an open source messaging middleware produced by Apache, designed to provide efficient , scalable, stable, and secure enterprise-level messaging communications. ActiveMQ implements JMS 1.1 and provides many additional features, such as JMX management, master-slave management, message group communication, message priority, delayed message reception, virtual receivers, message persistence, message queue monitoring, etc. The main features are as follows:
Supports clients and protocols in multiple languages such as Java, C, C, C#, Ruby, Perl, Python, PHP, etc., such as OpenWire, STOMP, AMQP, and MQTT protocols.
Provides advanced features such as message group communication, message priority, delayed message reception, virtual receivers, and message persistence.
Fully supports JMS 1.1 and J2EE 1.4 specifications (including persistence, distributed transaction messages, transactions)
Supports Spring framework, ActiveMQ can be easily embedded in Spring applications through Spring configuration files .
Passed common J2EE server tests, such as TomEE, Geronimo, JBoss, GlassFish, and WebLogic.
Diversified connection methods, ActiveMQ provides a variety of connection methods, such as in-VM, TCP, SSL, NIO, UDP, multicast, JGroups, JXTA.
Supports fast persistence of messages through the use of JDBC and Journal.
Designed for high-performance cluster, client-server, point-to-point communication and other scenarios.
Provides a technology- and language-neutral REST API interface.
Supports calling ActiveMQ via AJAX.
ActiveMQ can be easily integrated with WebService technologies such as CXF and Axis to provide reliable messaging.
Can be used as an in-memory JMS provider, very suitable for JMS unit testing.
Kafka
1.Kafka features:
Kafka was first developed by LinkedIn as a distributed publish/subscribe messaging system. , which later became Apache's top-level project. Its main features are as follows:
Provides high throughput for both publishing and subscription. (Kafka’s design goal is to provide message persistence capabilities with a time complexity of O(1). It can guarantee constant-time access performance even for data above the TB level, and can do it even on very cheap commercial machines. Supports the transmission of 100K messages per second to a single machine)
Message persistence. (Persist messages to disk, so can be used for batch consumption, such as ETL as well as real-time applications. Data loss can be prevented by persisting data to hard disk and replicating it.)
Distributed. (Supports message partitioning and distributed consumption between servers, while ensuring the sequential transmission of messages within each Partition. Its internal Producer, Broker and Consumer are all distributed architectures, which makes it easier to expand outwards.)
Consuming messages adopts Pull mode. (The status of the message being processed is maintained on the Consumer side, not on the server side. The Broker is stateless and the Consumer saves the offset itself.)
Supports Online and Offline scenarios, as well as offline data processing and real-time data deal with.
RocketMQ
1. RocketMQ features:
RocketMQ is a distributed messaging middleware open sourced by Alibaba in 2012 and later donated to Apache software Foundation, and became an Apache top-level project on September 25, 2017. As a domestic middleware that has experienced many "super projects" such as Alibaba's "Double 11" and has stable and outstanding performance, it has been used by more and more domestic users in recent years for its high performance, low latency and high reliability. Used by businesses. Its main features are as follows:
It has flexible scalability. (RocketMQ naturally supports clusters, and each of its four core components (NameServer, Broker, Producer, and Consumer) can be horizontally expanded without a single point of failure.)
Has the ability to accumulate massive messages. (RocketMQ uses the zero-copy principle to achieve the ability to accumulate extremely large amounts of messages. It is said that a single machine can support the accumulation of hundreds of millions of messages, and it still maintains low writing latency after accumulating so many messages)
Supports sequential messages. (RocketMQ can ensure that message consumers consume messages in the order in which they are sent. Sequential messages are divided into globally ordered messages and locally ordered messages. It is generally recommended to use locally ordered messages, that is, the producer sends a certain type of message in order Send to the same queue to achieve.)
Supports multiple message filtering methods. (Message filtering is divided into server-side filtering and consumer-side filtering. When filtering on the server side, filtering can be performed according to the requirements of message consumers. The advantage is that unnecessary message transmission is reduced, and the disadvantage is that it increases the burden on the message server. Implementation Relatively complex. Consumer-side filtering is completely customized by specific applications. This method is more flexible. The disadvantage is that many useless messages will be transmitted to message consumers.)
Support transaction messages. (In addition to supporting ordinary messages and sequential messages, RocketMQ also supports transaction messages. This feature provides another solution for distributed transactions.)
Supports backtracking consumption. (Retroactive consumption means that messages that have been successfully consumed by consumers need to be consumed again due to business needs. RocketMQ supports retroactive consumption according to time. The time dimension is accurate to milliseconds, and can be traced forward or backward.)
MoreFAQ, please visit the PHP Chinese website.
The above is the detailed content of What are rpc middleware?. For more information, please follow other related articles on the PHP Chinese website!

RPC服务器不可用进不了桌面怎么办近年来,计算机和互联网已经深入到我们的生活中的各个角落。作为一种集中计算和资源共享的技术,远程过程调用(RPC)在网络通信中起着至关重要的作用。然而,有时我们可能会遇到RPC服务器不可用的情况,导致无法进入桌面。本文将介绍一些可能导致此问题的原因,并提供解决方案。首先,我们需要了解RPC服务器不可用的原因。RPC服务器是一种

随着互联网技术的发展,分布式系统的应用越来越广泛,而远程过程调用(RPC)作为分布式系统中的重要通信方式,也受到了越来越多的关注和应用。在众多的RPC框架中,Go语言作为一种快速高效的编程语言,也拥有着丰富的RPC框架选择。本文将针对Go语言RPC框架进行盘点,介绍五大热门选择,并给出具体的代码示例,帮助读者更好地了解和选择适合自己项目的RPC框架。1.g

现在越来越多的企业级应用需要运行在国产化环境中,本文介绍下我们产品使用的中间件在国产操作系统银河麒麟的安装(不一定是最优方式,但能用)。包含;Nginx、Redis、RabbitMQ、MongoDB、dotNETCore。下图是银河麒麟服务器的信息:想要顺利安装需要确保:1、服务器能访问网络。想要完全离线的方式安装会更复杂,需要进一步研究。2、修改yum源。使用vi/etc/yum.repos.d/kylin_aarch64.repo来设置yum源,文件内容如下:###KylinLinuxAdv

基于ThinkPHP6和Swoole的高并发RPC服务实践引言:在现代的Web应用开发中,高并发是一个非常重要的问题。随着互联网的快速发展和用户量的增加,传统的Web架构已经无法满足对高并发的需求。为了解决这个问题,我们可以使用基于RPC(远程过程调用)的架构来实现高并发服务。本文将介绍如何使用ThinkPHP6和Swoole来搭建一个高并发的RPC服务,并

Go作为一门快速高效的编程语言,有着广泛的运用,其中之一就是网络编程。在网络编程中经常会遇到请求频率过高的问题,这时一个常用的解决方案就是利用RateLimiter中间件进行限制。但是,在实际应用中,还是有很多人遇到了无法正确使用RateLimiter中间件的问题,下面就来分析一下可能的原因,及解决方案。1.未正确导入相关包使用RateLimiter需要导入

随着互联网的快速发展和云计算技术的广泛应用,分布式系统和微服务架构变得越来越普遍。在这样的背景下,远程过程调用(RPC)成为了一种常见的技术手段。RPC能够使得不同的服务在网络上实现远程调用,从而实现不同服务之间的互联操作,提高代码的复用性和可伸缩性。PHP作为一种广泛应用的Web开发语言,也很常用于各种分布式系统的开发。那么,如何在PHP中实现RPC远程调

使用Swoole实现高性能的RPC框架随着互联网的快速发展,RPC(远程过程调用)成为了构建分布式系统的重要组成部分。然而,传统的RPC框架在高并发场景下往往表现不佳,响应时间较长,影响系统的性能。而Swoole作为一款纯C语言编写的高性能异步网络通信引擎,具备协程支持和高并发处理能力,为我们实现高性能的RPC框架提供了有力的支持。本文将介绍如何使用Swoo

Golang开发:使用RPC实现跨进程通信,需要具体代码示例一、介绍RPCRPC(RemoteProcedureCall)是一种远程过程调用协议,它使得客户端可以调用位于远程计算机上的服务端程序的函数或方法,就像调用本地函数一样。RPC可以使用不同的网络协议实现,如TCP、HTTP等。在分布式系统中,RPC是一种重要的通信机制,常用于跨进程或跨网络节点的

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
