RabbitMQ:安装客户端库erlang

6yoyoihd  于 2022-12-08  发布在  Erlang
关注(0)|答案(2)|浏览(266)

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?

du7egjpx

du7egjpx2#

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").

相关问题