# RabbitMQ C AMQP client library
![Build Status](https://github.com/alanxz/rabbitmq-c/actions/workflows/ci.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/alanxz/rabbitmq-c/badge.svg?branch=master)](https://coveralls.io/github/alanxz/rabbitmq-c?branch=master)
## Introduction
This is a C-language AMQP client library for use with v2.0+ of the
[RabbitMQ](http://www.rabbitmq.com/) broker.
- <http://github.com/alanxz/rabbitmq-c>
Announcements regarding the library are periodically made on the
rabbitmq-c-users and cross-posted to rabbitmq-users.
- <https://groups.google.com/forum/#!forum/rabbitmq-c-users>
- <https://groups.google.com/forum/#!forum/rabbitmq-users>
## Latest Stable Version
The latest stable release of rabbitmq-c can be found at:
- <https://github.com/alanxz/rabbitmq-c/releases/latest>
## Documentation
API documentation for v0.8.0+ can viewed from:
<http://alanxz.github.io/rabbitmq-c/docs/0.8.0/>
## Getting started
### Building and installing
#### Prereqs:
- [CMake v3.12 or better](http://www.cmake.org/)
- A C compiler (GCC 4.4+, clang, and MSVC are test. Other compilers may also
work)
- *Optionally* [OpenSSL](http://www.openssl.org/) v1.1.1+ to enable support for
connecting to RabbitMQ over SSL/TLS
- *Optionally* [POpt](http://freecode.com/projects/popt) to build some handy
command-line tools.
- *Optionally* [XmlTo](https://fedorahosted.org/xmlto/) to build man pages for
the handy command-line tools
- *Optionally* [Doxygen](http://www.stack.nl/~dimitri/doxygen/) to build
developer API documentation.
After downloading and extracting the source from a tarball to a directory
([see above](#latest-stable-version)), the commands to build rabbitmq-c on most
systems are:
mkdir build && cd build
cmake ..
cmake --build . [--config Release]
The --config Release flag should be used in multi-configuration generators e.g.,
Visual Studio or XCode.
It is also possible to point the CMake GUI tool at the CMakeLists.txt in the root of
the source tree and generate build projects or IDE workspace
Installing the library and optionally specifying a prefix can be done with:
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . [--config Release] --target install
More information on CMake can be found on its FAQ (http://www.cmake.org/Wiki/CMake_FAQ)
Other interesting flags that can be passed to CMake:
* `BUILD_EXAMPLES=ON/OFF` toggles building the examples. ON by default.
* `BUILD_SHARED_LIBS=ON/OFF` toggles building rabbitmq-c as a shared library.
ON by default.
* `BUILD_STATIC_LIBS=ON/OFF` toggles building rabbitmq-c as a static library.
OFF by default.
* `BUILD_TESTING=ON/OFF` toggles building test code. ON by default.
* `BUILD_TOOLS=ON/OFF` toggles building the command line tools. By default
this is ON if the build system can find the POpt header and library.
* `BUILD_TOOLS_DOCS=ON/OFF` toggles building the man pages for the command line
tools. By default this is ON if BUILD_TOOLS is ON and the build system can
find the XmlTo utility.
* `ENABLE_SSL_SUPPORT=ON/OFF` toggles building rabbitmq-c with SSL support. By
default this is ON if the OpenSSL headers and library can be found.
* `BUILD_API_DOCS=ON/OFF` - toggles building the Doxygen API documentation, by
default this is OFF
* `RUN_SYSTEM_TESTS=ON/OFF` toggles building the system tests (i.e. tests requiring
an accessible RabbitMQ server instance on localhost), by default this is OFF
## Building RabbitMQ - Using vcpkg
You can download and install RabbitMQ using the [vcpkg](https://github.com/Microsoft/vcpkg)
dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install librabbitmq
The RabbitMQ port in vcpkg is kept up to date by Microsoft team members and
community contributors. If the version is out of date,
please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
## Running the examples
Arrange for a RabbitMQ or other AMQP server to be running on
`localhost` at TCP port number 5672.
In one terminal, run
./examples/amqp_listen localhost 5672 amq.direct test
In another terminal,
./examples/amqp_sendstring localhost 5672 amq.direct test "hello world"
You should see output similar to the following in the listener's
terminal window:
Delivery 1, exchange amq.direct routingkey test
Content-type: text/plain
----
00000000: 68 65 6C 6C 6F 20 77 6F : 72 6C 64 hello world
0000000B:
## Writing applications using `librabbitmq`
Please see the `examples` directory for short examples of the use of
the `librabbitmq` library.
### Threading
You cannot share a socket, an `amqp_connection_state_t`, or a channel
between threads using `librabbitmq`. The `librabbitmq` library is
built with event-driven, single-threaded applications in mind, and
does not yet cater to any of the requirements of `pthread`ed
applications.
Your applications instead should open an AMQP connection (and an
associated socket, of course) per thread. If your program needs to
access an AMQP connection or any of its channels from more than one
thread, it is entirely responsible for designing and implementing an
appropriate locking scheme. It will generally be much simpler to have
a connection exclusive to each thread that needs AMQP service.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
RabbitMQ C AMQP客户端库 介绍 这是C语言AMQP客户端库,可与代理的v2.0 +一起使用。 有关该库的公告会定期在rabbitmq-c用户上发布,并交叉发布到rabbitmq-users。 最新稳定版 可以在以下位置找到rabbitmq-c的最新稳定版本: 文献资料 v0.8.0 +的API文档可以从以下位置查看: 入门 建造和安装 先决条件: AC编译器(已测试GCC 4.4 +,clang和MSVC。其他编译器也可以工作) 可选的 v1.1.1 +,以支持通过SSL / TLS连接到RabbitMQ (可选)选择以构建一些方便的命令行工具。 (可选) 为方便的命令行工具构建手册页 可选地来构建开发人员API文档。 将源文件从tarball下载并解压缩到目录()后,在大多数系统上构建Rabbitmq-c的命令为: mkdir build && cd bui
资源详情
资源评论
资源推荐
收起资源包目录
rabbitmq-c:RabbitMQ C客户端 (102个子文件)
AUTHORS 86B
amqp_framing.c 103KB
amqp_socket.c 42KB
amqp_openssl.c 22KB
amqp_connection.c 19KB
amqp_table.c 18KB
test_tables.c 14KB
amqp_api.c 13KB
common.c 12KB
amqp_consumer.c 10KB
consume.c 8KB
test_parse_url.c 8KB
test_merge_capabilities.c 7KB
amqp_rpc_sendstring_client.c 7KB
amqp_consumer.c 7KB
test_basic.c 7KB
amqp_tcp_socket.c 6KB
amqp_mem.c 6KB
amqp_time.c 6KB
publish.c 6KB
process.c 6KB
amqp_url.c 5KB
utils.c 5KB
amqp_producer.c 5KB
amqp_listen.c 5KB
amqp_openssl_bio.c 4KB
amqp_ssl_connect.c 4KB
amqp_listenq.c 4KB
amqp_sendstring.c 3KB
amqp_unbind.c 3KB
amqp_bind.c 3KB
amqp_exchange_declare.c 3KB
amqp_connect_timeout.c 3KB
process.c 3KB
delete_queue.c 3KB
test_sasl_mechanism.c 3KB
declare_queue.c 3KB
get.c 2KB
compat.c 2KB
platform_utils.c 2KB
test_status_enum.c 2KB
platform_utils.c 2KB
threads.c 2KB
model.c 656B
.clang-format 1KB
FindXMLTO.cmake 3KB
FindPOPT.cmake 1KB
VersionFunctions.cmake 974B
TestCInline.cmake 953B
COPYING-CMAKE-SCRIPTS 1KB
test_tables.expected 1KB
.gitattributes 330B
.gitignore 1KB
.gitmodules 125B
amqp.h 91KB
framing.h 49KB
amqp_private.h 12KB
ssl_socket.h 9KB
inttypes.h 7KB
amqp_socket.h 6KB
amqp_time.h 4KB
amqp_table.h 3KB
common.h 3KB
tcp_socket.h 2KB
threads.h 2KB
utils.h 2KB
amqp_framing.h 2KB
process.h 2KB
process.h 2KB
amqp.h 2KB
compat.h 2KB
amqp_tcp_socket.h 1KB
amqp_ssl_socket.h 1KB
amqp_openssl_bio.h 1KB
threads.h 1KB
Doxyfile.in 11KB
librabbitmq.pc.in 322B
config.h.in 215B
rabbitmq-c-config.cmake.in 117B
LICENSE-MIT 1KB
ChangeLog.md 12KB
README.md 5KB
CONTRIBUTING.md 916B
codegen.py 26KB
travis.sh 3KB
regenerate_framing.sh 622B
clang-format.sh 54B
THANKS 243B
TODO 424B
CMakeLists.txt 8KB
CMakeLists.txt 5KB
CMakeLists.txt 2KB
CMakeLists.txt 2KB
CMakeLists.txt 2KB
amqp-consume.xml 9KB
amqp-publish.xml 7KB
amqp-declare-queue.xml 4KB
librabbitmq-tools.xml 4KB
amqp-get.xml 3KB
amqp-delete-queue.xml 3KB
共 102 条
- 1
- 2
胡説个球
- 粉丝: 25
- 资源: 4613
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- MyBatis 动态 SQL:灵活而强大的查询构建器.pdf
- com.accordion.prettyo.apk
- 毕业设计:基于SSM的mysql-ssm软件bug管理系统(源码 + 数据库 + 说明文档)
- MTSQL8.0.35windows(64bit)-mysql-installer-community-8.0.35.0
- 人工智能引领音乐创作新时代之Suno AI
- Public-bicycle-usage-forecast-master.zip
- 通道处理过程模拟:从理论到实践.pdf
- 数据库第七次作业E-R图第一题
- 大厂面试真题Java语法基础面试专题及答案
- IMG20240428211124.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0