# RabbitMQ C AMQP client library
[![Build Status](https://secure.travis-ci.org/alanxz/rabbitmq-c.png?branch=master)](http://travis-ci.org/alanxz/rabbitmq-c)
## 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 v2.6 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/) v0.9.8+ 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_TESTS=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.
* `ENABLE_THREAD_SAFETY=ON/OFF` toggles OpenSSL thread-safety. By default this
is ON
* `BUILD_API_DOCS=ON/OFF` - toggles building the Doxygen API documentation, by
default this is OFF
#### autotools
For legacy purposes, a GNU autotools based build system is also maintained. The required
utilities you need are autoconf v2.59+, automake v1.9+, libtool v2.2+, and pkg-config.
Then the standard autotools build procedure will build rabbitmq-c:
autoreconf -i
./configure
make
make install
## 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-master.rar_RabbitMQ c lib_cmake编译_rabbitmq_rabbitmq-c
共142个文件
c:55个
h:20个
cmake:8个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 165 浏览量
2022-09-23
18:31:00
上传
评论
收藏 268KB RAR 举报
温馨提示
使用cmake编译安装好之后即可使用 具体步骤可参见网上教程
资源推荐
资源详情
资源评论
收起资源包目录
rabbitmq-c-master.rar_RabbitMQ c lib_cmake编译_rabbitmq_rabbitmq-c (142个子文件)
configure.ac 7KB
Makefile.am 10KB
AUTHORS 86B
CMakeDetermineCompilerABI_C.bin 30KB
amqp_framing.c 96KB
amqp_socket.c 41KB
amqp_table.c 18KB
amqp_openssl.c 18KB
amqp_connection.c 18KB
CMakeCCompilerId.c 17KB
test_tables.c 13KB
amqp_api.c 13KB
common.c 12KB
amqp_consumer.c 10KB
consume.c 8KB
test_parse_url.c 8KB
amqps_consumer.c 8KB
amqp_rpc_sendstring_client.c 7KB
test_merge_capabilities.c 7KB
amqp_consumer.c 7KB
amqp_time.c 6KB
amqp_tcp_socket.c 6KB
amqp_mem.c 6KB
publish.c 6KB
amqp_openssl_hostname_validation.c 6KB
amqps_producer.c 6KB
process.c 6KB
amqp_hostcheck.c 6KB
amqps_listen.c 5KB
amqp_url.c 5KB
amqp_producer.c 5KB
amqps_listenq.c 5KB
utils.c 5KB
amqp_listen.c 4KB
amqps_sendstring.c 4KB
amqps_unbind.c 4KB
amqps_bind.c 4KB
amqps_exchange_declare.c 4KB
amqp_openssl_bio.c 4KB
amqp_listenq.c 4KB
amqps_connect_timeout.c 4KB
amqp_sendstring.c 4KB
amqp_unbind.c 3KB
amqp_bind.c 3KB
amqp_exchange_declare.c 3KB
amqp_connect_timeout.c 3KB
process.c 3KB
declare_queue.c 3KB
delete_queue.c 3KB
test_sasl_mechanism.c 3KB
get.c 2KB
test_hostcheck.c 2KB
compat.c 2KB
platform_utils.c 2KB
test_status_enum.c 2KB
platform_utils.c 2KB
threads.c 2KB
model.c 655B
CMakeTestCInline.c 124B
cmake.check_cache 86B
.clang-format 1KB
GNUInstallDirs.cmake 7KB
CMakePushCheckState.cmake 5KB
FindXmlTo.cmake 3KB
CMakeCCompiler.cmake 2KB
FindPOPT.cmake 1KB
TestCInline.cmake 983B
CMakeSystem.cmake 395B
CMakeRCCompiler.cmake 212B
COPYING-CMAKE-SCRIPTS 1KB
CompilerIdC.exe 10KB
test_tables.expected 1KB
.gitattributes 330B
.gitignore 1KB
.gitignore 63B
.gitmodules 94B
amqp.h 93KB
amqp_framing.h 41KB
amqp_private.h 14KB
inttypes.h 8KB
stdint.h 8KB
amqp_ssl_socket.h 7KB
amqp_socket.h 6KB
amqp_time.h 5KB
amqp_table.h 3KB
common.h 3KB
amqp_openssl_hostname_validation.h 2KB
amqp_tcp_socket.h 2KB
utils.h 2KB
amqp_hostcheck.h 2KB
threads.h 2KB
process.h 2KB
process.h 2KB
compat.h 2KB
amqp_openssl_bio.h 1KB
threads.h 1KB
Doxyfile.in 11KB
librabbitmq.pc.in 322B
config.h.in 283B
CompilerIdC.lastbuildstate 218B
共 142 条
- 1
- 2
资源评论
JonSco
- 粉丝: 66
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- YOLOV4-TINY权重文件
- 以下是一个使用贪心算法解决多机调度问题的基本步骤0.txt
- 基于大数据的房产估价是近年来随着技术的发展而兴起的一种新型估价方法.txt
- 企业供应链管理系统v3.rar
- 富芮坤FR8016HA蓝牙开发板使用手册+硬件PCB图+封装库+DEMO演示软件源代码.zip
- 基于YOLOv7的芯片表面缺陷检测系统
- 京东物流 数字化供应链综合研究报告2018.rar
- 基于YOLOv7的植物虫害识别&防治系统
- 2000.1-2023.8中国经济政策不确定性指数月度数据.xlsx
- Screenshot_2024-04-21-20-42-15-443_com.tencent.mm.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功