简体   繁体   中英

RabbitMQ: Install client library erlang

I tried to install rabbitMQ at my Archlinux machine.

I managed to install the server and run it as a service.

How can I install rabbitMQ Erlang client library?

The www.rabbitmq.com has only link to the library to download

Any idea where to put this files?

From RabbitMQ documentation:

To gain access to these records, you need to include
the amqp_client.hrl in every module that uses the Erlang client:
-include("amqp_client.hrl").

Where should this file be located?

See http://www.erlang.org/doc/man/code.html

.ez is a regular ZIP file

I read your question again and I misread it the first time. There is a great mini walkthrough on how to setup a new project with the Erlang RabbitMQ libraries with Rebar. Rebar is a great build tool for Erlang projects.


Generally speaking, the hrl file should be in the same directory as the erlang file that needs it. Alternatively, you can setup a directory hierarchy with your source in one directory and the hrl files in another, and reference the hrl file with a relative path. For example, if you had the directory structure below, as you might with a rebar based project:

project
|
|----ebin
|    compiled_file.beam
|
|----src
|    srouce_file.erl
|
|----include
     include_file.hrl

and you wanted to include include_file.hrl in source_file.erl, would write at the top of source_file.erl:

-include("../include/include_file.hrl").

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM