<div dir="ltr">Hi,<div><br></div><div>If you are using <a href="http://erlang.mk" target="_blank">erlang.mk</a> or rebar3 as build tool, you could just add amqp_client to your dependencies, and everything will start working automagically. </div><div><br></div><div>If for some legacy reasons you are using rebar2, then you could use rebar-friendly fork of client at <a href="https://github.com/jbrisbin/amqp_client">https://github.com/jbrisbin/amqp_client</a></div><div><br></div><div><br></div><div>Best,</div><div>Alexey</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-16 18:09 GMT+03:00 YuanZhiqian <span dir="ltr"><<a href="mailto:on-your-mark@hotmail.com" target="_blank">on-your-mark@hotmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Hi guys,<div><br></div><div> 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. <a href="https://www.rabbitmq.com/erlang-client.html" style="font-size:12pt" target="_blank">https://www.rabbitmq.com/erlang-client.html</a></div><div><br></div><div> 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, <a href="http://www.erlang.org/doc/man/code.html" style="font-size:12pt" target="_blank">http://www.erlang.org/doc/man/code.html</a>, besides, I'm not very sure how to use a .ez archive file.</div><div><br></div><div> 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. </div><div><br></div><div> I have tried using rebar and make to build the source code, but both failed with complaints as folllows:</div><div><br></div><div><br></div><div><div>$ rebar compile</div><div>==> amqp_client-3.5.7-src (compile)</div><div>include/amqp_client.hrl:20: can't find include lib "rabbit_common/include/rabbit.hrl"</div><div>include/amqp_client.hrl:21: can't find include lib "rabbit_common/include/rabbit_framing.hrl"</div><div>src/amqp_gen_connection.erl:313: undefined macro 'INTERNAL_ERROR'</div><div>include/amqp_client.hrl:23: record 'P_basic' undefined</div><div>src/amqp_gen_connection.erl:174: record amqp_error undefined</div><div>src/amqp_gen_connection.erl:176: record amqp_error undefined</div><div>src/amqp_gen_connection.erl:212: function internal_error/3 undefined</div><div>src/amqp_gen_connection.erl:215: record 'connection.close' undefined</div><div>src/amqp_gen_connection.erl:266: record 'connection.close' undefined</div><div>src/amqp_gen_connection.erl:273: record 'connection.close' undefined</div><div>src/amqp_gen_connection.erl:275: record 'connection.close_ok' undefined</div><div>src/amqp_gen_connection.erl:280: record 'connection.blocked' undefined</div><div>src/amqp_gen_connection.erl:285: record 'connection.unblocked' undefined</div><div>src/amqp_gen_connection.erl:291: record amqp_error undefined</div><div>src/amqp_gen_connection.erl:352: record 'connection.close' undefined</div><div>src/amqp_gen_connection.erl:355: record 'connection.close' undefined</div><div>src/amqp_gen_connection.erl:357: variable 'Code' is unbound</div><div>src/amqp_gen_connection.erl:357: variable 'Text' is unbound</div><div>src/amqp_gen_connection.erl:368: record 'connection.close_ok' undefined</div><div>src/amqp_gen_connection.erl:290: Warning: variable 'Other' is unused</div></div><div><br></div><div><br></div><div><br></div><div><div>$ make</div><div>rm -f <a href="http://deps.mk" target="_blank">deps.mk</a></div><div>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 <a href="http://deps.mk" target="_blank">deps.mk</a> ebin</div><div>escript: Failed to open file: ../rabbitmq-server/generate_deps</div><div>make: *** No rule to make target `<a href="http://deps.mk" target="_blank">deps.mk</a>', needed by `ebin/amqp_auth_mechanisms.beam'. Stop.</div></div><div><br></div><div><br></div><div><br></div><div>Besides, in the README file, the instruction tells me to do like this:</div><div><br></div><div><br></div><div><div> $ git clone <a href="https://github.com/rabbitmq/rabbitmq-codegen.git" target="_blank">https://github.com/rabbitmq/rabbitmq-codegen.git</a></div><div> $ git clone <a href="https://github.com/rabbitmq/rabbitmq-server.git" target="_blank">https://github.com/rabbitmq/rabbitmq-server.git</a></div><div> $ git clone <a href="https://github.com/rabbitmq/rabbitmq-erlang-client.git" target="_blank">https://github.com/rabbitmq/rabbitmq-erlang-client.git</a></div><div> $ cd rabbitmq-erlang-client</div><div> $ make</div></div><div><br></div><div> 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.</div><div><br></div><div><br></div><div>To make a conclusion, my trouble here is:</div><div><br></div><div>1. Should I use .ez archive file or source code?</div><div>2. How to use .ez archive file, is it safe?</div><div>3. How should I deal with the compile errors?</div><div>4. Why do I need to clone another client's source code as told by the README file?</div><div><br></div><div>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. </div><div><br></div><div><br></div><div> Any advice is appreciated :)</div><div><br></div><div>Best regards</div><div>Zhiqian</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div> </div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>