## Apache RocketMQ
[![Build Status](https://travis-ci.org/apache/rocketmq.svg?branch=master)](https://travis-ci.org/apache/rocketmq) [![Coverage Status](https://coveralls.io/repos/github/apache/rocketmq/badge.svg?branch=master)](https://coveralls.io/github/apache/rocketmq?branch=master)
[![CodeCov](https://codecov.io/gh/apache/rocketmq/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/rocketmq)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.rocketmq/rocketmq-all/badge.svg)](http://search.maven.org/#search%7Cga%7C1%7Corg.apache.rocketmq)
[![GitHub release](https://img.shields.io/badge/release-download-orange.svg)](https://rocketmq.apache.org/dowloading/releases)
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/apache/rocketmq.svg)](http://isitmaintained.com/project/apache/rocketmq "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/apache/rocketmq.svg)](http://isitmaintained.com/project/apache/rocketmq "Percentage of issues still open")
[![Twitter Follow](https://img.shields.io/twitter/follow/ApacheRocketMQ?style=social)](https://twitter.com/intent/follow?screen_name=ApacheRocketMQ)
**[Apache RocketMQ](https://rocketmq.apache.org) is a distributed messaging and streaming platform with low latency, high performance and reliability, trillion-level capacity and flexible scalability.**
It offers a variety of features:
* Messaging patterns including publish/subscribe, request/reply and streaming
* Financial grade transactional message
* Built-in fault tolerance and high availability configuration options base on [DLedger Controller](docs/cn/controller/quick_start.md)
* Built-in message tracing capability, also support opentracing
* Versatile big-data and streaming ecosystem integration
* Message retroactivity by time or offset
* Reliable FIFO and strict ordered messaging in the same queue
* Efficient pull and push consumption model
* Million-level message accumulation capacity in a single queue
* Multiple messaging protocols like gRPC, MQTT, JMS and OpenMessaging
* Flexible distributed scale-out deployment architecture
* Lightning-fast batch message exchange system
* Various message filter mechanics such as SQL and Tag
* Docker images for isolated testing and cloud isolated clusters
* Feature-rich administrative dashboard for configuration, metrics and monitoring
* Authentication and authorization
* Free open source connectors, for both sources and sinks
* Lightweight real-time computing
----------
## Quick Start
This paragraph guides you through steps of installing RocketMQ in different ways.
For local development and testing, only one instance will be created for each component.
### Run RocketMQ locally
RocketMQ runs on all major operating systems and requires only a Java JDK version 8 or higher to be installed.
To check, run `java -version`:
```shell
$ java -version
java version "1.8.0_121"
```
For Windows users, click [here](https://archive.apache.org/dist/rocketmq/4.9.3/rocketmq-all-4.9.3-bin-release.zip) to download the 4.9.3 RocketMQ binary release,
unpack it to your local disk, such as `D:\rocketmq`.
For macOS and Linux users, execute following commands:
```shell
# Download release from the Apache mirror
$ wget https://archive.apache.org/dist/rocketmq/4.9.3/rocketmq-all-4.9.3-bin-release.zip
# Unpack the release
$ unzip rocketmq-all-4.9.3-bin-release.zip
```
Prepare a terminal and change to the extracted `bin` directory:
```shell
$ cd rocketmq-4.9.3/bin
```
**1) Start NameServer**
NameServer will be listening at `0.0.0.0:9876`, make sure that the port is not used by others on the local machine, and then do as follows.
For macOS and Linux users:
```shell
### start Name Server
$ nohup sh mqnamesrv &
### check whether Name Server is successfully started
$ tail -f ~/logs/rocketmqlogs/namesrv.log
The Name Server boot success...
```
For Windows users, you need set environment variables first:
- From the desktop, right click the Computer icon.
- Choose Properties from the context menu.
- Click the Advanced system settings link.
- Click Environment Variables.
- Add Environment `ROCKETMQ_HOME="D:\rocketmq"`.
Then change directory to rocketmq, type and run:
```shell
$ mqnamesrv.cmd
The Name Server boot success...
```
**2) Start Broker**
For macOS and Linux users:
```shell
### start Broker
$ nohup sh bin/mqbroker -n localhost:9876 &
### check whether Broker is successfully started, eg: Broker's IP is 192.168.1.2, Broker's name is broker-a
$ tail -f ~/logs/rocketmqlogs/broker.log
The broker[broker-a, 192.169.1.2:10911] boot success...
```
For Windows users:
```shell
$ mqbroker.cmd -n localhost:9876
The broker[broker-a, 192.169.1.2:10911] boot success...
```
### Run RocketMQ in Docker
You can run RocketMQ on your own machine within Docker containers,
`host` network will be used to expose listening port in the container.
**1) Start NameServer**
```shell
$ docker run -it --net=host apache/rocketmq ./mqnamesrv
```
**2) Start Broker**
```shell
$ docker run -it --net=host --mount source=/tmp/store,target=/home/rocketmq/store apache/rocketmq ./mqbroker -n localhost:9876
```
### Run RocketMQ in Kubernetes
You can also run a RocketMQ cluster within a Kubernetes cluster using [RocketMQ Operator](https://github.com/apache/rocketmq-operator).
Before your operations, make sure that `kubectl` and related kubeconfig file installed on your machine.
**1) Install CRDs**
```shell
### install CRDs
$ git clone https://github.com/apache/rocketmq-operator
$ cd rocketmq-operator && make deploy
### check whether CRDs is successfully installed
$ kubectl get crd | grep rocketmq.apache.org
brokers.rocketmq.apache.org 2022-05-12T09:23:18Z
consoles.rocketmq.apache.org 2022-05-12T09:23:19Z
nameservices.rocketmq.apache.org 2022-05-12T09:23:18Z
topictransfers.rocketmq.apache.org 2022-05-12T09:23:19Z
### check whether operator is running
$ kubectl get pods | grep rocketmq-operator
rocketmq-operator-6f65c77c49-8hwmj 1/1 Running 0 93s
```
**2) Create Cluster Instance**
```shell
### create RocketMQ cluster resource
$ cd example && kubectl create -f rocketmq_v1alpha1_rocketmq_cluster.yaml
### check whether cluster resources is running
$ kubectl get sts
NAME READY AGE
broker-0-master 1/1 107m
broker-0-replica-1 1/1 107m
name-service 1/1 107m
```
---
## Apache RocketMQ Community
* [RocketMQ Streams](https://github.com/apache/rocketmq-streams): A lightweight stream computing engine based on Apache RocketMQ.
* [RocketMQ Flink](https://github.com/apache/rocketmq-flink): The Apache RocketMQ connector of Apache Flink that supports source and sink connector in data stream and Table.
* [RocketMQ APIs](https://github.com/apache/rocketmq-apis): RocketMQ protobuf protocol.
* [RocketMQ Clients](https://github.com/apache/rocketmq-clients): gRPC/protobuf-based RocketMQ clients.
* RocketMQ Native Protocol-Based Clients
- [RocketMQ Client CPP](https://github.com/apache/rocketmq-client-cpp)
- [RocketMQ Client Go](https://github.com/apache/rocketmq-client-go)
- [RocketMQ Client Python](https://github.com/apache/rocketmq-client-python)
- [RocketMQ Client Nodejs](https://github.com/apache/rocketmq-client-nodejs)
* [RocketMQ Spring](https://github.com/apache/rocketmq-spring): A project which helps developers quickly integrate Apache RocketMQ with Spring Boot.
* [RocketMQ Exporter](https://github.com/apache/rocketmq-exporter): An Apache RocketMQ exporter for Prometheus.
* [RocketMQ Operator](https://github.com/apache/rocketmq-operator): Providing a way to run an Apache RocketMQ cluster on Kubernetes.
* [RocketMQ Docker](https://github.com/apache/rocketmq-docker): The Git repo of the Docker Image for Apache RocketMQ
rocketmq中间件
需积分: 0 132 浏览量
更新于2023-02-12
收藏 103.35MB RAR 举报
RocketMQ是阿里巴巴开源的一款分布式消息中间件,广泛应用于大数据、实时计算、微服务等领域,具有高可用、高并发、低延迟等特性。本压缩包包含了RocketMQ的三个不同版本,以及其控制台管理工具的jar包,使得用户可以更加方便地部署、管理和监控RocketMQ集群。
1. **RocketMQ的基本概念**
- **消息模型**:RocketMQ支持发布/订阅模型和点对点模型,前者用于广播消息,后者确保消息仅被一个消费者消费。
- **角色组件**:包括NameServer、Producer、Consumer和Broker。NameServer负责路由信息管理,Producer发送消息,Consumer接收消息,Broker存储消息。
- **消息队列**:消息在系统中以队列的形式存在,每个队列可以被多个消费者并行消费,提高处理效率。
2. **RocketMQ的版本**
- **5.0.0** 版本:这是一个重要的里程碑,可能引入了新的特性和性能优化,例如增强的事务消息、更高效的调度算法、更丰富的监控指标等。具体细节需要查看官方文档或变更日志来了解。
3. **RocketMQ的部署与运行**
- **启动NameServer**:作为无状态的服务,一般需要启动多份以实现高可用。
- **部署Broker**:Broker负责存储和传输消息,配置包括磁盘空间、网络设置、集群模式等。
- **创建Producer与Consumer**:编程接口允许开发者创建Producer发送消息,Consumer订阅并消费消息。
- **Topic与Queue**:Topic是消息的主题,Queue是消息实际存储的地方,一个Topic可以有多个Queue,多个Consumer可以并行消费同一个Queue。
4. **RocketMQ控制台**
- **Console.jar**:提供了图形化的管理界面,便于查看和操作RocketMQ集群的状态,如查看Topic、消费进度、监控消息流量等。
- **部署与使用**:将Console.jar部署到服务器,通过浏览器访问,输入相关配置连接到RocketMQ集群,进行监控和管理。
5. **RocketMQ的高级特性**
- **消息回溯**:允许消费者回溯消费历史消息,对于故障恢复或数据审计有重要作用。
- **延时消息**:消息可以在特定时间后才被消费,适用于定时任务场景。
- **顺序消息**:保证消息按照发送顺序消费,适用于金融交易等对顺序敏感的场景。
- **分布式事务**:提供分布式事务的支持,保证跨服务操作的原子性。
6. ** RocketMQ的应用场景**
- **大数据处理**:作为数据交换平台,连接数据生产者和消费者。
- **实时计算**:作为实时流处理的通道,提供低延迟的消息传递。
- **微服务通信**:在微服务架构中,RocketMQ可以作为服务间的解耦工具,降低服务间的依赖。
7. **运维与调优**
- **监控与报警**:利用RocketMQ提供的监控接口,结合第三方监控工具(如Prometheus、Grafana)进行性能监控和异常报警。
- **性能调优**:包括调整Message Store的参数、优化网络通信、增加NameServer和Broker的数量等。
以上是对RocketMQ中间件及其提供的压缩包内容的简要介绍,深入学习和应用RocketMQ,还需要阅读官方文档,理解其设计理念,掌握API使用,并结合具体业务场景进行实践。
![avatar](https://profile-avatar.csdnimg.cn/6abba91f3ba34406bb396118bb8d7d54_m0_62434717.jpg!1)
杨宸杨
- 粉丝: 2116
- 资源: 2
最新资源
- 基于单片机的视力保护器设计.zip
- 利用zigbee的无线单片机温度计课程设计2.zip
- 四轴飞行器-概念扫盲.zip
- 2218_144564123.html
- PictureCleaner图像漂白软件免费(内含效果图)
- 视频号无限制,AI一键生成原创视频项目玩法教程
- 冷门出行高峰来袭,里程积分项目玩法教程,高爆发期
- 电气安装工 三级工.pdf
- 整蛊无人直播项目玩法教程,支持抖音快手,利用矢重闪光
- 新起店项目玩法教程,拼多多虚拟电商,24小时实现成交
- 淘宝掘金项目玩法教程,单机操作收益
- arduino+android制作的智能家居系统(含源码、文档)
- 电气安装工 四级工.pdf
- Seetong监控软件Windows版
- 独家珍藏免费分享——智能家居控制系统完整设计方案(含设计方案、原理图、多功能面板、智能插座原理图、智能控制器等)
- 信用卡评分模型数据kaggle竞赛2019