[erlang-questions] Use Erlang AMQP client library

Loïc Hoguin <>
Thu Dec 17 10:12:14 CET 2015


3.5.7 is the old build system, not Erlang.mk. It requires you to fetch 
extra repositories manually, from what I understand.

Erlang.mk fetches everything automatically.

On 12/17/2015 09:51 AM, YuanZhiqian wrote:
> Hi Alexey,
>
>    It's interesting that I've just tried copying rebar.config from
> the rebar-friendly fork to the canonical repository, what I intended is
> to tell rebar to find the correct dependency, and then I ran rebar
> get-deps && rebar compile, everything worked perfect.
>
>    So I guess there's something wrong with the erlang.mk so that it's
> unsuccessful to build using 'make'
>
> Best,
> Zhiqian
>
> ------------------------------------------------------------------------
> Date: Wed, 16 Dec 2015 20:36:01 +0300
> Subject: Re: [erlang-questions] Use Erlang AMQP client library
> From: 
> To: 
> CC: 
>
> Hi,
>
> The better place to ask this sort of questions is at rabbitmq-users
> mailing list.
>
> But to summarize:
> - Failure with rebar is an expected outcome, it's not the right build tool
> - Failure with source tarball and `make` is an error - I've filed an
> issue at https://github.com/rabbitmq/rabbitmq-erlang-client/issues/29
> - Failure to build from github checkout with `make` - couldn't reproduce
> it. Probably it's some problem with your build environment, but more
> details are needed if you want help from somebody )
>
> Best,
> Alexey
>
> 2015-12-16 20:11 GMT+03:00 YuanZhiqian <
> <mailto:>>:
>
>     Thanks Alexey:), I'll have a try tomorrow. However there seems a lot
>     of compilation errors when building rabbitmq from code, do you have
>     a clue?
>
>     发自我的 iPhone
>
>     在 2015年12月17日,01:06,Alexey Lebedeff <
>     <mailto:>> 写道:
>
>         Hi,
>
>         If you are using erlang.mk <http://erlang.mk> or rebar3 as build
>         tool, you could just add amqp_client to your dependencies, and
>         everything will start working automagically.
>
>         If for some legacy reasons you are using rebar2, then you could
>         use rebar-friendly fork of client at
>         https://github.com/jbrisbin/amqp_client
>
>
>         Best,
>         Alexey
>
>         2015-12-16 18:09 GMT+03:00 YuanZhiqian <
>         <mailto:>>:
>
>             Hi guys,
>
>                I have a frustrating time tonight trying to use rabbitmq
>             library for erlang in my project. There're two ways provided
>             by the official sites: .ez archive file as well as in source
>             code. https://www.rabbitmq.com/erlang-client.html
>
>                I wonder which one I should choose. I prefer to use the
>             source code because in erlang's documentation page, it is
>             said the loading code from archive file is an experimental
>             feature and is not recommend,
>             http://www.erlang.org/doc/man/code.html, besides, I'm not
>             very sure how to use a .ez archive file.
>
>                On the other hand, the source code won't compile through,
>             I searched in google and people says that it is not wise to
>             compile source code by one's own to use rabbitmq at present,
>             because of some tricky problem.
>
>                I have tried using rebar and make to build the source
>             code, but both failed with complaints as folllows:
>
>
>             $ rebar compile
>             ==> amqp_client-3.5.7-src (compile)
>             include/amqp_client.hrl:20: can't find include lib
>             "rabbit_common/include/rabbit.hrl"
>             include/amqp_client.hrl:21: can't find include lib
>             "rabbit_common/include/rabbit_framing.hrl"
>             src/amqp_gen_connection.erl:313: undefined macro
>             'INTERNAL_ERROR'
>             include/amqp_client.hrl:23: record 'P_basic' undefined
>             src/amqp_gen_connection.erl:174: record amqp_error undefined
>             src/amqp_gen_connection.erl:176: record amqp_error undefined
>             src/amqp_gen_connection.erl:212: function internal_error/3
>             undefined
>             src/amqp_gen_connection.erl:215: record 'connection.close'
>             undefined
>             src/amqp_gen_connection.erl:266: record 'connection.close'
>             undefined
>             src/amqp_gen_connection.erl:273: record 'connection.close'
>             undefined
>             src/amqp_gen_connection.erl:275: record
>             'connection.close_ok' undefined
>             src/amqp_gen_connection.erl:280: record 'connection.blocked'
>             undefined
>             src/amqp_gen_connection.erl:285: record
>             'connection.unblocked' undefined
>             src/amqp_gen_connection.erl:291: record amqp_error undefined
>             src/amqp_gen_connection.erl:352: record 'connection.close'
>             undefined
>             src/amqp_gen_connection.erl:355: record 'connection.close'
>             undefined
>             src/amqp_gen_connection.erl:357: variable 'Code' is unbound
>             src/amqp_gen_connection.erl:357: variable 'Text' is unbound
>             src/amqp_gen_connection.erl:368: record
>             'connection.close_ok' undefined
>             src/amqp_gen_connection.erl:290: Warning: variable 'Other'
>             is unused
>
>
>
>             $ make
>             rm -f deps.mk <http://deps.mk>
>             echo
>             src/amqp_auth_mechanisms.erl:src/amqp_channel.erl:src/amqp_channels_manager.erl:src/amqp_channel_sup.erl:src/amqp_channel_sup_sup.erl:src/amqp_client.erl:src/amqp_connection.erl:src/amqp_connection_sup.erl:src/amqp_connection_type_sup.erl:src/amqp_direct_connection.erl:src/amqp_direct_consumer.erl:src/amqp_gen_connection.erl:src/amqp_gen_consumer.erl:src/amqp_main_reader.erl:src/amqp_network_connection.erl:src/amqp_rpc_client.erl:src/amqp_rpc_server.erl:src/amqp_selective_consumer.erl:src/amqp_sup.erl:src/amqp_uri.erl:src/rabbit_routing_util.erl:src/uri_parser.erl:include/amqp_client.hrl:include/amqp_client_internal.hrl:include/amqp_gen_consumer_spec.hrl:include/rabbit_routing_prefixes.hrl:
>             | escript ../rabbitmq-server/generate_deps deps.mk
>             <http://deps.mk> ebin
>             escript: Failed to open file: ../rabbitmq-server/generate_deps
>             make: *** No rule to make target `deps.mk <http://deps.mk>',
>             needed by `ebin/amqp_auth_mechanisms.beam'.  Stop.
>
>
>
>             Besides, in the README file, the instruction tells me to do
>             like this:
>
>
>               $ git clone https://github.com/rabbitmq/rabbitmq-codegen.git
>               $ git clone https://github.com/rabbitmq/rabbitmq-server.git
>               $ git clone
>             https://github.com/rabbitmq/rabbitmq-erlang-client.git
>               $ cd rabbitmq-erlang-client
>               $ make
>
>                Well, it won't compile too! And I am even more confused
>             why I need to clone the rabbit erlang client again in this
>             case, since the README file itself is already in the
>             client's source code directory.
>
>
>             To make a conclusion, my trouble here is:
>
>             1. Should I use .ez archive file or source code?
>             2. How to use .ez archive file, is it safe?
>             3. How should I deal with the compile errors?
>             4. Why do I need to clone another client's source code as
>             told by the README file?
>
>             I am used to put a library in "deps" folder in my project
>             and rebar would build them altogether for me, I think that's
>             a preferable choice, quite clear in terms of project's
>             folder layout at least.
>
>
>                Any advice is appreciated :)
>
>             Best regards
>             Zhiqian
>
>
>
>
>
>
>
>
>
>
>
>
>             _______________________________________________
>             erlang-questions mailing list
>              <mailto:>
>             http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>

-- 
Loïc Hoguin
http://ninenines.eu
Author of The Erlanger Playbook,
A book about software development using Erlang


More information about the erlang-questions mailing list