zeromq/libzmq
GitHub: zeromq/libzmq
ZeroMQ 是一个轻量级异步消息内核,通过扩展标准 Socket 接口来简化分布式系统的通信构建。
Stars: 10814 | Forks: 2471
# ZeroMQ
[](https://github.com/zeromq/libzmq/actions/workflows/CI.yaml)
[](https://ci.appveyor.com/project/zeromq/libzmq)
[](https://coveralls.io/github/zeromq/libzmq?branch=master)
[](https://conan.io/center/zeromq)
## 欢迎
ZeroMQ 轻量级消息内核是一个库,它通过传统上由专用消息中间件产品提供的功能扩展了标准 socket 接口。ZeroMQ socket 提供了异步消息队列的抽象、多种消息模式、消息过滤(订阅)、对多种传输协议的无缝访问等功能。
## 支持的平台
Libzmq 主要使用 C++98 编写,并包含一些可选的 C++11 片段。配置方面采用了 autotools 或 CMake。以下是已成功编译 libzmq 的平台列表。
### 主要 CI 支持的平台
| OS 和版本 | 架构 | 编译器和版本 | 构建系统 | 备注 |
|----------------------------------------|-------------------------|-------------------------------|--------------|---------------------------------------------------------------------------------------------------------------------------------------|
| Android NDK r25 | arm, arm64, x86, x86_64 | llvm (参见 NDK) | autotools | DRAFT |
| Ubuntu 14.04.5 LTS (trusty) | amd64 | clang 5.0.0 | autotools | STABLE, 附加功能: GSSAPI, PGM, NORM, 仅 C++98 模式 |
| Ubuntu 14.04.5 LTS (trusty) | amd64 | gcc 4.8.4 | autotools | STABLE, DRAFT, 附加功能: GSSAPI, PGM, NORM, TIPC, IPV6, 以及 POLLER=poll, POLLER=select, 以及 valgrind 和 address sanitizer 执行 |
| Ubuntu 14.04.5 LTS (trusty) | amd64 | gcc 4.8.4 | CMake 3.12.2 | STABLE |
| Windows Server 2012 R2 | x86 | Visual Studio 2008 | CMake 3.12.2 | DRAFT |
| Windows Server 2012 R2 | x86 | Visual Studio 2010 SP1 | CMake 3.12.2 | DRAFT |
| Windows Server 2012 R2 | x86 | Visual Studio 2012 Update 5 | CMake 3.12.2 | DRAFT |
| Windows Server 2012 R2 | x86, amd64 | Visual Studio 2013 Update 5 | CMake 3.12.2 | DRAFT, STABLE (仅 x86 Release), 以及 POLLER=epoll |
| Windows Server 2012 R2 | x86 | Visual Studio 2015 Update 3 | CMake 3.12.2 | DRAFT |
| Windows Server 2016 | x86 | Visual Studio 2017 15.9.6 | CMake 3.13.3 | DRAFT |
| cygwin 3.0.0 on Windows Server 2012 R2 | amd64 | gcc 7.4.0 | CMake 3.6.2 | DRAFT |
| MSYS2 ? on Windows Server 2012 R2 | amd64 | gcc 6.4.0 | CMake ? | DRAFT |
| Mac OS X 10.13 | amd64 | Xcode 9.4.1, Apple LLVM 9.1.0 | autotools | STABLE, DRAFT |
| Mac OS X 10.13 | amd64 | Xcode 9.4.1, Apple LLVM 9.1.0 | CMake 3.11.4 | DRAFT |
注意:平台会由服务提供商定期更新,因此即使 libzmq 方面没有任何更改,此信息也可能会过时。关于 Appveyor,请参阅 https://www.appveyor.com/updates/ 了解平台更新。关于 travis-ci,请参阅 https://changelog.travis-ci.com/ 了解平台更新。
### 次要 CI 支持的平台
| OS 和版本 | 架构 | 编译器和版本 | 构建系统 | 备注 |
|------------------------------|----------------------------|----------------------|--------------|---------|
| CentOS 6 | x86, amd64 | ? | autotools | |
| CentOS 7 | amd64 | ? | autotools | |
| Debian 8.0 | x86, amd64 | ? | autotools | |
| Debian 9.0 | ARM64, x86, amd64 | ? | autotools | |
| Fedora 28 | ARM64, ARM32, amd64 | ? | autotools | |
| Fedora 29 | ARM64, ARM32, amd64 | ? | autotools | |
| Fedora Rawhide | ARM64, ARM32, amd64 | ? | autotools | |
| RedHat Enterprise Linux 7 | amd64, ppc64 | ? | autotools | |
| SuSE Linux Enterprise 12 SP4 | ARM64, amd64, ppc64, s390x | ? | autotools | |
| SuSE Linux Enterprise 15 | amd64 | ? | autotools | |
| xUbuntu 12.04 | x86, amd64 | ? | autotools | |
| xUbuntu 14.04 | x86, amd64 | ? | autotools | |
| xUbuntu 16.04 | x86, amd64 | ? | autotools | |
| xUbuntu 18.04 | x86, amd64 | ? | autotools | |
| xUbuntu 18.10 | x86, amd64 | ? | autotools | |
### 已知有活跃用户支持的平台
截至撰写本文时,尚无明确的报告。请通过提交 PR 添加条目或从下面的部分移动条目来报告您的体验。
在“最后报告”下,如果是未发布版本,请注明 SHA1;如果是已发布版本,请注明版本号。
| OS 和版本 | 架构 | 编译器和版本 | 构建系统 | 最后报告 | 备注 |
|----------------|-------------------|----------------------|--------------|-------------------------|---------|
| Solaris 10 | x86, amd64, sparc | GCC 8.1.0 | CMake | 2019/03/18 | |
| DragonFly BSD | amd64 | gcc 8.3 | autotools | 2018/08/07 git-72854e63 | |
| IBM i | ppc64 | gcc 6.3 | autotools | 2019/10/02 git-25320a3 | |
| QNX 7.0 | x86_64 | gcc 5.4.0 | CMake | 4.3.2 | |
| Windows 10 | ARM64 | Visual Studio 2019 | CMake | 2021/11/15 git-2375ca8b | |
| Windows 10 | ARM64 | clang | CMake | 2021/11/15 git-2375ca8b | |
### 无已知活跃用户支持的平台
注意:此列表不完整且不准确,仍需一些工作。
| OS 和版本 | 架构 | 编译器和版本 | 构建系统 | 备注 |
|------------------------|--------------|--------------------------|------------------|---------|
| Any Linux distribution | x86, amd64 | gcc ?+, clang ?+, icc ?+ | autotools, CMake | |
| SunOS, Solaris | x86, amd64 | SunPro | autotools, CMake | |
| GNU/kFreeBSD | ? | ? | autotools, CMake | |
| FreeBSD | ? | ? | autotools, CMake | |
| NetBSD | ? | ? | autotools, CMake | |
| OpenBSD | ? | ? | autotools, CMake | |
| DragonFly BSD | amd64 | gcc 8.3 | autotools, CMake | |
| HP-UX | ? | ? | autotools, CMake | |
| GNU/Hurd | ? | ? | autotools | |
| VxWorks 6.8 | ? | ? | ? | |
| Windows CE | ? | ? | ? | |
| Windows UWP | ? | ? | ? | |
| OpenVMS | ? | ? | ? | |
### 不支持的平台
| OS 和版本 | 架构 | 编译器和版本 | 备注 |
|----------------|--------------|----------------------|-------------------------------------------------------------------------|
| QNX 6.3 | ? | gcc 3.3.5 | 参见 #3371,支持由用户添加,但未贡献给上游 |
欲知更多详情,请参阅[此处](SupportedPlatforms.md)。
对于某些平台(Linux, Mac OS X),[ZeroMQ 组织提供预构建的二进制包](#installation)。
对于其他平台,您需要[构建您自己的二进制文件](#build)。
## 二进制包安装
### Linux
对于 Linux 用户,大多数发行版都提供预构建的二进制包。
请注意,DRAFT API 随时可能更改,恕不另行通知,请选择 STABLE 版本以避免启用它们。
#### 最新版本
##### DEB
[](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Arelease-stable&package=libzmq3-dev)
[](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Arelease-draft&package=libzmq3-dev)
##### RPM
[](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Arelease-stable&package=zeromq-devel)
[](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Arelease-draft&package=zeromq-devel)
#### 前沿版本包
##### DEB
[](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-stable&package=libzmq3-dev)
[](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-draft&package=libzmq3-dev)
##### RPM
[](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-stable&package=zeromq-devel)
[](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-draft&package=zeromq-devel)
#### 示例:Debian 9 最新版本,无 DRAFT API
```
echo "deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/ ./" >> /etc/apt/sources.list
wget https://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/Release.key -O- | sudo apt-key add
apt-get install libzmq3-dev
```
### OSX
对于 OSX 用户,可以通过 brew 获取软件包。
```
brew install zeromq
```
## 包管理器安装
### vcpkg
vcpkg 是一个全平台包管理器,您可以通过 vcpkg 轻松安装 libzmq。
```
git clone https://github.com/microsoft/vcpkg.git
./bootstrap-vcpkg.bat # For powershell
./bootstrap-vcpkg.sh # For bash
./vcpkg install zeromq
```
## 从源代码构建
要从源代码构建,请参阅发行版中包含的 INSTALL 文件。
### Android
要从源代码构建,请参阅 android 构建目录中的 [README](./builds/android/README.md) 文件。
## 资源
发行版提供了详尽的文档。请参阅 doc/zmq.html,或在您的系统上安装 libzmq 后参阅 "man zmq"。
网站:http://www.zeromq.org/
开发邮件列表:zeromq-dev@lists.zeromq.org
公告邮件列表:zeromq-announce@lists.zeromq.org
Git 仓库:http://github.com/zeromq/libzmq
也可以在 Libera Chat 网络 的 #zeromq IRC 频道上找到 ZeroMQ 开发者。
## 许可证
项目许可证在 LICENSE 中指定。
libzmq 是自由软件;您可以根据 Mozilla Public License 2.0 版的条款重新分发和/或修改它。
## 贡献
本项目使用 [C4(集体代码构建合同)](https://rfc.zeromq.org/spec:42/C4/) 流程进行贡献。
标签:Autotools, Bash脚本, C++, CMake, Socket编程, TCP/IP, ZeroMQ, ZMTP, 分布式系统, 即时通讯, 响应大小分析, 多模式消息, 并发计算, 开源库, 异步IO, 微服务通信, 搜索引擎爬虫, 数据擦除, 消息中间件, 消息队列, 网络库