Apache RocketMQ是一个开源的分布式消息中间件系统,最初由阿里巴巴开发并贡献给Apache软件基金会。RocketMQ提供了高性能、高可靠性、高扩展性和低延迟的消息传递服务,适用于构建大规模分布式系统中的消息通信和数据同步。
RocketMQ支持多种消息模型,包括点对点(P2P)和发布/订阅(Pub/Sub)模型。它具有以下特性:
按照下面步骤,通过Docker Compose 一键快速部署 RocketMQ
复制下面的内容,创建 docker-compose.yml
文件
version: '3.8'
services:
namesrv:
image: registry.cn-hangzhou.aliyuncs.com/jeecgdocker/rocketmq:4.9.6
container_name: rmqnamesrv
ports:
- 9876:9876
networks:
- rocketmq
command: sh mqnamesrv
broker:
image: registry.cn-hangzhou.aliyuncs.com/jeecgdocker/rocketmq:4.9.6
container_name: rmqbroker
ports:
- 10909:10909
- 10911:10911
- 10912:10912
environment:
- NAMESRV_ADDR=namesrv:9876
depends_on:
- namesrv
networks:
- rocketmq
command: sh mqbroker
dashboard:
image: registry.cn-hangzhou.aliyuncs.com/jeecgdocker/rocketmq-dashboard:latest
container_name: rmqdashboard
ports:
- 8080:8080
environment:
- JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876
depends_on:
- namesrv
networks:
- rocketmq
networks:
rocketmq:
driver: bridge
执行下面命令,根据 docker-compose.yml 创建RockerMQ集群
docker-compose up -d
根据 docker-compose.yml 文件关闭所有服务。
docker-compose down
关于RocketMQ如何集成到项目中使用,可以参考JeecgBoot开源项目
https://github.com/jeecgboot/JeecgBoot