What are rpc middleware?
# 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!

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics











What should I do if the RPC server is unavailable and cannot be accessed on the desktop? In recent years, computers and the Internet have penetrated into every corner of our lives. As a technology for centralized computing and resource sharing, Remote Procedure Call (RPC) plays a vital role in network communication. However, sometimes we may encounter a situation where the RPC server is unavailable, resulting in the inability to enter the desktop. This article will describe some of the possible causes of this problem and provide solutions. First, we need to understand why the RPC server is unavailable. RPC server is a

How to use middleware to handle form validation in Laravel, specific code examples are required Introduction: Form validation is a very common task in Laravel. In order to ensure the validity and security of the data entered by users, we usually verify the data submitted in the form. Laravel provides a convenient form validation function and also supports the use of middleware to handle form validation. This article will introduce in detail how to use middleware to handle form validation in Laravel and provide specific code examples.

The principle of tomcat middleware is implemented based on Java Servlet and Java EE specifications. As a Servlet container, Tomcat is responsible for processing HTTP requests and responses and providing the running environment for Web applications. The principles of Tomcat middleware mainly involve: 1. Container model; 2. Component architecture; 3. Servlet processing mechanism; 4. Event listening and filters; 5. Configuration management; 6. Security; 7. Clustering and load balancing; 8. Connector technology; 9. Embedded mode, etc.

How to use middleware for data acceleration in Laravel Introduction: When developing web applications using the Laravel framework, data acceleration is the key to improving application performance. Middleware is an important feature provided by Laravel that handles requests before they reach the controller or before the response is returned. This article will focus on how to use middleware to achieve data acceleration in Laravel and provide specific code examples. 1. What is middleware? Middleware is a mechanism in the Laravel framework. It is used

How to use middleware for response conversion in Laravel Middleware is one of the very powerful and practical features in the Laravel framework. It allows us to process requests and responses before the request enters the controller or before the response is sent to the client. In this article, I will demonstrate how to use middleware for response transformation in Laravel. Before starting, make sure you have Laravel installed and a new project created. Now we will follow these steps: Create a new middleware Open

Laravel is a popular PHP web application framework that provides many fast and easy ways to build efficient, secure and scalable web applications. When developing Laravel applications, we often need to consider the issue of data recovery, that is, how to recover data and ensure the normal operation of the application in the event of data loss or damage. In this article, we will introduce how to use Laravel middleware to implement data recovery functions and provide specific code examples. 1. What is Lara?

How to set up Cross-Origin Resource Sharing (CORS) using middleware in the Slim framework Cross-Origin Resource Sharing (CORS) is a mechanism that allows the server to set some additional information in the HTTP response header to tell the browser whether Allow cross-domain requests. In some projects with front-end and back-end separation, the CORS mechanism can be used to realize the front-end's cross-domain request for the back-end interface. When using the Slim framework to develop REST API, we can use middleware (Middleware)

How to use middleware for scheduled task scheduling in Laravel Introduction: Laravel is a popular PHP open source framework that provides convenient and powerful tools to develop web applications. One of the important features is scheduled tasks, which allows developers to run specific tasks at specified intervals. In this article, we will introduce how to use middleware to implement Laravel's scheduled task scheduling, and provide specific code examples. Environment Preparation Before starting, we need to make sure