RabbitMQ C客户端-C/C++开发

  • C3_129771
    了解作者
  • 206.2KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-27 09:15
    上传日期
RabbitMQ C AMQP客户端库简介这是C语言AMQP客户端库,可与RabbitMQ代理的v2.0 +一起使用。 http://github.com/alanxz/rabbitmq-c有关该库的声明是perio RabbitMQ C AMQP客户端库简介这是C语言AMQP客户端库,可与RabbitMQ代理的v2.0 +一起使用。 http://github.com/alanxz/rabbitmq-c有关该库的公告会定期在rabbitmq-c-users上发布并交叉发布到rabbitmq-users。 https://groups.google.com/forum/#!forum/rabbitmq-c-users https://groups.google.com/forum/#!forum/rabbitmq-users最新稳定版本Rabbitmq-的最新稳定版本c可以在以下网址找到:https:// github
rabbitmq-c-master.zip
  • rabbitmq-c-master
  • .gitmodules
    125B
  • THANKS
    243B
  • travis.sh
    3KB
  • LICENSE-MIT
    1.3KB
  • cmake
  • config.h.in
    151B
  • FindXMLTO.cmake
    3.1KB
  • COPYING-CMAKE-SCRIPTS
    1.3KB
  • rabbitmq-c-config.cmake.in
    117B
  • FindPOPT.cmake
    1.2KB
  • VersionFunctions.cmake
    974B
  • docs
  • Doxyfile.in
    11.2KB
  • tools
  • win32
  • compat.c
    1.9KB
  • compat.h
    1.5KB
  • process.c
    5.6KB
  • process.h
    1.7KB
  • common.c
    11.9KB
  • common.h
    2.9KB
  • get.c
    2.4KB
  • unix
  • process.c
    2.8KB
  • process.h
    1.6KB
  • doc
  • amqp-declare-queue.xml
    4.4KB
  • amqp-delete-queue.xml
    3KB
  • librabbitmq-tools.xml
    3.5KB
  • amqp-get.xml
    3.1KB
  • amqp-consume.xml
    9.1KB
  • amqp-publish.xml
    6.7KB
  • consume.c
    8.1KB
  • delete_queue.c
    2.6KB
  • CMakeLists.txt
    2.4KB
  • publish.c
    5.8KB
  • declare_queue.c
    2.5KB
  • .github
  • workflows
  • codeql-analysis.yml
    1KB
  • ci.yml
    1.7KB
  • tests
  • test_parse_url.c
    7.7KB
  • test_tables.expected
    1.2KB
  • test_sasl_mechanism.c
    2.6KB
  • test_merge_capabilities.c
    7.1KB
  • test_status_enum.c
    1.8KB
  • test_tables.c
    13.5KB
  • test_basic.c
    6.8KB
  • CMakeLists.txt
    1.3KB
  • include
  • amqp.h
    1.6KB
  • amqp_framing.h
    1.7KB
  • amqp_ssl_socket.h
    1.5KB
  • amqp_tcp_socket.h
    1.5KB
  • rabbitmq-c
  • framing.h
    49.1KB
  • amqp.h
    91.1KB
  • tcp_socket.h
    2.2KB
  • ssl_socket.h
    9.2KB
  • TODO
    424B
  • CONTRIBUTING.md
    916B
  • .clang-format
    1.4KB
  • regenerate_framing.sh
    622B
  • travis
  • clang-format.sh
    54B
  • run-clang-format
  • AUTHORS
    86B
  • examples
  • amqp_unbind.c
    3.1KB
  • amqp_ssl_connect.c
    4.1KB
  • amqp_listenq.c
    3.8KB
  • win32
  • platform_utils.c
    1.7KB
  • amqp_connect_timeout.c
    3.1KB
  • unix
  • platform_utils.c
    1.8KB
  • amqp_listen.c
    4.5KB
  • amqp_rpc_sendstring_client.c
    7.1KB
  • utils.c
    4.7KB
  • amqp_producer.c
    4.7KB
  • amqp_exchange_declare.c
    3.1KB
  • amqp_bind.c
    3.1KB
  • amqp_sendstring.c
    3.4KB
  • amqp_consumer.c
    6.9KB
  • utils.h
    1.8KB
  • CMakeLists.txt
    1.8KB
  • .gitignore
    1.2KB
  • coverity
  • model.c
    656B
  • CMakeLists.txt
    8.1KB
  • librabbitmq.pc.in
    322B
  • README.md
    5.3KB
  • ChangeLog.md
    11.9KB
  • .gitattributes
    330B
  • librabbitmq
  • amqp_framing.c
    103.1KB
  • amqp_connection.c
    18.6KB
  • amqp_api.c
    12.6KB
内容介绍
# 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.
评论
    相关推荐