jbrisbin / amqp_client Goto Github PK
View Code? Open in Web Editor NEWRebar-friendly fork of rabbitmq-erlang-client
Rebar-friendly fork of rabbitmq-erlang-client
In the original sources the option prefer_ipv6
is set in the environment of the amqp_client application, this should also be done in this repository.
Refer to this commit:
https://github.com/issuu/amqp_client/commit/24e3303e30cef278977aa65cf1a793c4bf8552d1#diff-2
Tried to run on OTP 22 but it appears this build doesn't support it yet. When do we expect support to happen.
$ rebar compile generate
==> goldrush (compile)
==> lager (compile)
==> cowlib (compile)
==> ranch (compile)
==> cowboy (compile)
==> jiffy (compile)
==> rabbit_common (compile)
ERROR: OTP release 22 does not match required regex 17|18|19
ERROR: compile failed while processing /Users/oladipo/Projects/Erlang/myapp/deps/rabbit_common: rebar_abort
I'm getting this error
Elixir.FunctionClauseError: no function clause matches
File "lists.erl", line 147, in :lists.reverse(%{"service" => %{__meta__: #Ecto.Schema.Metadata<:loaded, "services">, estimated_price: 9.6e4, estimated_time: 31, inserted_at: #Ecto.DateTime<2017-01-27 00:13:30>, price: -1.0, scheduled_time: nil, status: 3, total_km: 14, total_time: 0,...
File "src/rabbit_binary_generator.erl", line 84, in :rabbit_binary_generator.build_content_frames/3
File "src/rabbit_binary_generator.erl", line 73, in :rabbit_binary_generator.build_simple_content_frames/4
File "src/rabbit_writer.erl", line 312, in :rabbit_writer.assemble_frames/5
File "src/rabbit_writer.erl", line 342, in :rabbit_writer.internal_send_command_async/3
File "src/rabbit_writer.erl", line 210, in :rabbit_writer.handle_message/3
File "src/rabbit_writer.erl", line 194, in :rabbit_writer.mainloop1/2
File "src/rabbit_writer.erl", line 185, in :rabbit_writer.mainloop/2
The problem is with rabbit common, I think is a bad idea to fetch from master
amqp_channel_sup crashed after bad request in channel and didn't start new child. The problem arise when I try to make a bad request in channel, for example, publish string message instead of binary.
ERROR message:
[error] Error in process <0.138.0> on node 'dev@prots' with exit value: {badarg,[{erlang,size,"t",[]},{rabbit_binary_generator,build_content_frames,7,[{file,"src/rabbit_binary_generator.erl"},{line,98}]},{rabbit_binary_generator,build_simple_content_frames,4,[{file,"src/rabbit_binary_ge...
18:36:56.194 [error] Supervisor {<0.135.0>,amqp_channel_sup} had child writer started with rabbit_writer:start_link(#Port<0.4123>, 2, 131072, rabbit_framing_amqp_0_9_1, <0.137.0>, {<<"client 10.21.2.166:34725 -> 10.56.128.24:5672">>,2}) at <0.138.0> exit with reason bad argument in call to erlang:size(116) in rabbit_binary_generator:build_content_frames/7 line 98 in context child_terminated
18:36:56.194 [error] Supervisor {<0.135.0>,amqp_channel_sup} had child writer started with rabbit_writer:start_link(#Port<0.4123>, 2, 131072, rabbit_framing_amqp_0_9_1, <0.137.0>, {<<"client 10.21.2.166:34725 -> 10.56.128.24:5672">>,2}) at <0.138.0> exit with reason reached_max_restart_intensity in context shutdown
My rebar.config:
{erl_opts, [debug_info]}.
{deps, [
{amqp_client, ".*", {git, "git://github.com/jbrisbin/amqp_client.git", {tag, "rabbitmq-3.5.6-community"}}}
]
}.
The front page README.md refers to this tag, but it doesn't exist. Am I missing something?
I am trying to build using erlang.mk. Has anyone gotten that to work?
My build trips on this error:
deps/amqp-client/include/amqp_client.hrl:20: can't find include lib "rabbit_common/include/rabbit.hrl"
Documentation for amqp_connection:close/1
and amqp_connection:close/2
refer to channels.
My understanding is that those services are provided by amqp_channel:close/1
the reason is it does not reference the latest version of rabbit_common, as discussed in #32
So all people using master branch will have a non working version
There has been a new version of RabbitMQ released a while ago that should be merged.
Hi Jon, there are calls to credit_flow module in amqp_channel, but the module itself is missing. It exists in rabbitmq-server sources though: http://hg.rabbitmq.com/rabbitmq-server/file/3efed0ef3bf3/src/credit_flow.erl.
The current master
branch refers to version 3.6.2 (+patches) of amqp_client, but the rebar.config
file refers to 3.5.6 still. Furthermore, trying to build RabbitMQ fails on Erlang 18.3. It also looks like there is some build problem with the 3.6.2 patch in rabbit_common
but I have yet to investigate that.
Hej Jon,
can you cherry-pick the amqp_client commit which fixes a compile time bug?
rabbitmq/rabbitmq-erlang-client@57392ca#src/amqp_selective_consumer.erl
Thanks!
/Uwe
Currently unable to use amqp_client
with Erlang 19 when fetching from hex
. Any chance you could publish a new release?
So my project is using erlang.mk, and I having an error when trying to start an Erlang connection.
My code:
get_rabbit(Host, Port) ->
RabbitRecord = #amqp_params_network{
host=Host,
port=Port
},
{ok, Connection} = amqp_connection:start(RabbitRecord),
{ok, Channel} = amqp_connection:open_channel(Connection),
Channel.
My makefile has:
DEPS = amqp_client
dep_amqp_client = git://github.com/jbrisbin/amqp_client.git master
The code is pulled down my erlang.mk and built. When I try to run the above snippet I get the following error:
{error,{"no such file or directory","xmerl.app"}}
Any ideas? Thanks!
We have recently upgraded to Elixir 1.7/OTP 21 and are now getting tons of log messages like this:
[supervisor: {#PID<0.3153.0>, :amqp_channel_sup}, started: [pid: #PID<0.3154.0>, name: :gen_consumer, mfargs: {:amqp_gen_consumer, :start_link, [:amqp_selective_consumer, [], {"client 10.1.89.41:48516 -> 52.91.27.170:5672", 1}]}, restart_type: :intrinsic, shutdown: 30000, child_type: :worker]]
No idea why these started coming in or how to shut them off. We get them for name: :gen_consumer
, name: :channel
, and ``name: :writer`. They log out on every single message that comes through.
amqp_client version 3.6.16
I use rabbitmq-erlang-client rabbitmq_2.7.0 in my production env. Recently, I have found some error as "unexpected_delivery_and_no_default_consumer" in my server app log.
2016-08-26 15:25:00.465 [error] <0.1623.0> CRASH REPORT Process <0.1623.0> with 0 neighbours exited with reason: {unexpected_delivery_and_no_default_consumer,{gen_server2,call,[<0.1622.0>,{consumer_call,{'basic.deliver',<<"amq.ctag-2I715Fu1Q2m9AHgrhlN1Og">>,15804,false,<<"be3_statics_exchange">>,<<"be3_statics">>},{amqp_msg,{'P_basic',undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined},<<131,104,5,100,0,14,115,116,97,116,105,99,115,95,111,110,108,105,110,101,109,0,0,0,3,105,111,115,97,0,97,0,98,87,192,95,76>>}},infinity]}} in gen_server:terminate/7 line 826
rabbitmq consumer res:
be3_statics amq.ctag-hQQmjXButGMUQuHJQmSc4A true 0 [] be3_statics amq.ctag-f4VlH3_O5QBKXvyTl8xq8Q true 0 [] be3_statics amq.ctag-iY9xwuglKAkTS0baSZ8uyw true 0 [] be3_statics amq.ctag-uB1RG3JgzGi_YA6Qqy8G6w true 0 [] be3_statics amq.ctag-5VUGfvW4L3eO-7rVjG1Q0w true 0 [] be3_statics amq.ctag-OiWZBasEegvwJhB2taMayA true 0 [] be3_statics amq.ctag-ogUoP0BumVmsP2zaYiFPOg true 0 [] be3_statics amq.ctag-VcE4XGHk1DB5jqclnQDqhQ true 0 [] be3_statics amq.ctag-9TDHYscJrMun559kduyvEA true 0 [] be3_statics amq.ctag-g-M6m686GQOqvgeHEvzO2g true 0 []
my consumer config is as follows
#'basic.consume_ok'{consumer_tag = Tag} = amqp_channel:subscribe(Channel, #'basic.consume'{queue = Queue}, self()), %% no_ack = false
Also, I do not call the method 'basic.cancel'.
After viewing source code, I know it is happened when tag in Msg is not in consumer tags. I wonder
Thanks a lot.
Hej Jon,
rather a question than an issue: what's the reason for excluding the amqp_*_consumer.erl
files?
/Uwe
Cc: @seth
We recently bumped into an issue when using seth/pooler
to pool RabbitMQ channels. When the pooler culls stale channels, it kills them via exit(Pid, kill)
(instead of, say, doing it gracefully via amqp_channel:close
).
Long story short, amqp_client
interprets the killed channel as an internal_error
(541), and it then closes the AMQP connection entirely, which affects all of the other channels on that connection.
Behavior on both sides (pooler and amqp_client) makes sense when considered separately, but when combined, this is a problem. I mention this less as a bug report, and more as a heads-up -- perhaps something that could help other folks if it were documented?
The uses xmerl application from OTP, which is not started by default.
Could you update app.src with xmerl dependency?
Hello,
amqp_connection:start(#amqp_params_direct{}) or amqp_connection:start(#amqp_params_network{})
i have error
=INFO REPORT==== 26-Apr-2012::20:20:09 ===
application: amqp_client
exited: {bad_return,
{{amqp_client,start,[normal,[]]},
{'EXIT',
{undef,
[{supervisor2,start_link,
[{local,amqp_sup},amqp_sup,[]]},
{application_master,start_it_old,4}]}}}}
type: temporary
** exception throw: {error,{bad_return,{{amqp_client,start,[normal,[]]},
{'EXIT',{undef,[{supervisor2,start_link,
[{local,amqp_sup},amqp_sup,[]]},
{application_master,start_it_old,4}]}}}}}
in function amqp_connection:start/1
in call from userlog_app:test/0
RabbitMQ server 2.8.1/R14B04 x64
During compilation the following two types of warning are displayed:
Is this something that needs to be fixed upstream or something that must be tackled in this rebarized version?
I did try to compile from sources and no warnings are displayed (instructions used: https://www.rabbitmq.com/build-erlang-client.html). Could be that warnings are just being hidden by some extra compiler flag.
src/mirrored_supervisor.erl:137: Warning: behaviour supervisor2 undefined
/tmp/amqp_client/deps/rabbit_common/src/mirrored_supervisor.erl:137: Warning: behaviour supervisor2 undefined
src/credit_flow.erl:86: Warning: variable 'C' exported from 'case' (line 85)
src/credit_flow.erl:88: Warning: variable 'C' exported from 'case' (line 85)
src/credit_flow.erl:95: Warning: variable 'C' exported from 'case' (line 94)
src/credit_flow.erl:97: Warning: variable 'C' exported from 'case' (line 94)
src/credit_flow.erl:102: Warning: variable 'C' exported from 'case' (line 101)
src/credit_flow.erl:102: Warning: variable 'C' exported from 'case' (line 101)
src/credit_flow.erl:104: Warning: variable 'C' exported from 'case' (line 101)
src/credit_flow.erl:140: Warning: variable 'Deferred' exported from 'case' (line 140)
src/credit_flow.erl:148: Warning: variable 'Blocks' exported from 'case' (line 148)
src/credit_flow.erl:151: Warning: variable 'Blocks' exported from 'case' (line 151)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:86: Warning: variable 'C' exported from 'case' (line 85)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:88: Warning: variable 'C' exported from 'case' (line 85)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:95: Warning: variable 'C' exported from 'case' (line 94)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:97: Warning: variable 'C' exported from 'case' (line 94)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:102: Warning: variable 'C' exported from 'case' (line 101)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:102: Warning: variable 'C' exported from 'case' (line 101)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:104: Warning: variable 'C' exported from 'case' (line 101)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:140: Warning: variable 'Deferred' exported from 'case' (line 140)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:148: Warning: variable 'Blocks' exported from 'case' (line 148)
/tmp/amqp_client/deps/rabbit_common/src/credit_flow.erl:151: Warning: variable 'Blocks' exported from 'case' (line 151)
==> amqp_client (compile)
src/amqp_channel_sup.erl:22: Warning: behaviour supervisor2 undefined
src/amqp_channel_sup.erl:22: Warning: behaviour supervisor2 undefined
src/amqp_channel_sup_sup.erl:22: Warning: behaviour supervisor2 undefined
src/amqp_channel_sup_sup.erl:22: Warning: behaviour supervisor2 undefined
src/amqp_connection_sup.erl:22: Warning: behaviour supervisor2 undefined
src/amqp_connection_sup.erl:22: Warning: behaviour supervisor2 undefined
src/amqp_connection_type_sup.erl:22: Warning: behaviour supervisor2 undefined
src/amqp_connection_type_sup.erl:22: Warning: behaviour supervisor2 undefined
src/amqp_sup.erl:22: Warning: behaviour supervisor2 undefined
src/amqp_sup.erl:22: Warning: behaviour supervisor2 undefined
I am receiving an error when trying to use the version of rabbit_common from hex.
==> rabbit_common (compile)
compile: warnings being treated as errors
src/mirrored_supervisor.erl:137: behaviour gen_server2 undefined
Compiling src/mirrored_supervisor.erl failed:
src/mirrored_supervisor.erl:137: behaviour gen_server2 undefined
ERROR: compile failed while processing rabbit_common: rebar_abort
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.