Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #21 from pma/master

Update amqp_client to 3.5.0
  • Loading branch information...
commit 4e18a85fa362bd4fb26806388e942fa9ffef4f44 2 parents 35168d6 + fa1688e
@jbrisbin authored
View
2  Makefile
@@ -18,6 +18,6 @@ ERLC_OPTS = +debug_info \
COMPILE_FIRST = amqp_gen_consumer \
amqp_gen_connection
-dep_rabbit_common = git git://github.com/jbrisbin/rabbit_common.git rabbitmq-3.4.0
+dep_rabbit_common = git git://github.com/jbrisbin/rabbit_common.git rabbitmq-3.5.0
include erlang.mk
View
18 README.md
@@ -1,24 +1,24 @@
# Rebar-friendly fork of Erlang AMQP client
-This is a fork of the [official RabbitMQ/AMQP Erlang client](https://github.com/rabbitmq/rabbitmq-erlang-client).
+This is a fork of the [official RabbitMQ/AMQP Erlang client](https://github.com/rabbitmq/rabbitmq-erlang-client).
It's meant to be included in your rebar projects in your rebar.config file:
- {deps, [
- {amqp_client, ".*", {git, "git://github.com/jbrisbin/amqp_client.git", {tag, "rabbitmq-3.4.0"}}}
- ]}.
+ {deps, [
+ {amqp_client, ".*", {git, "git://github.com/jbrisbin/amqp_client.git", {tag, "rabbitmq-3.5.0"}}}
+ ]}.
The "master" branch of this port is a simple re-packaging of the rabbit_common AMQP client dependency.
The "community" branch, however, is a port of the RabbitMQ source code with additional strict compilation checking turned on and the source code edited to eliminate warnings. It should be 100% compatible with the unaltered source code. The community branch is simply a tweak to allow projects that depend on rabbit_common to not have to deal with the warnings issued by the compiler in the unaltered RabbitMQ code.
-To use the "community" branch in your project, which includes stricter compilation settings, add "-community"
+To use the "community" branch in your project, which includes stricter compilation settings, add "-community"
to the version tag:
- {deps, [
- {amqp_client, ".*", {git, "git://github.com/jbrisbin/amqp_client.git", {tag, "rabbitmq-3.4.0-community"}}}
- ]}.
+ {deps, [
+ {amqp_client, ".*", {git, "git://github.com/jbrisbin/amqp_client.git", {tag, "rabbitmq-3.5.0-community"}}}
+ ]}.
-### License
+### License
This package, just like the the RabbitMQ server, is licensed under the MPL. For the MPL, please see LICENSE-MPL-RabbitMQ.
View
5 rebar.config
@@ -1,5 +1,5 @@
{deps, [
- {rabbit_common, ".*", {git, "git://github.com/jbrisbin/rabbit_common.git", {tag, "rabbitmq-3.4.0"}}}
+ {rabbit_common, ".*", {git, "git://github.com/jbrisbin/rabbit_common.git", {tag, "rabbitmq-3.5.0"}}}
]}.
{erl_opts, [
@@ -12,6 +12,5 @@
warn_unused_function,
warn_deprecated_function,
warn_obsolete_guard,
- warn_unused_import,
- warnings_as_errors
+ warn_unused_import
]}.
View
2  src/amqp_client.app.src
@@ -1,6 +1,6 @@
{application, amqp_client,
[{description, "RabbitMQ Erlang Client Library"},
- {vsn, "3.4.0"},
+ {vsn, "3.5.0"},
{modules, []},
{registered, [amqp_sup]},
{env, [{prefer_ipv6, false}]},
View
3  src/amqp_direct_connection.erl
@@ -74,8 +74,7 @@ handle_message({force_event_refresh, Ref}, State = #state{node = Node}) ->
{ok, State};
handle_message(closing_timeout, State = #state{closing_reason = Reason}) ->
{stop, {closing_timeout, Reason}, State};
-handle_message({'DOWN', _MRef, process, _ConnSup, Reason},
- State = #state{node = _Node}) ->
+handle_message({'DOWN', _MRef, process, _ConnSup, Reason}, State) ->
{stop, {remote_node_down, Reason}, State};
handle_message(Msg, State) ->
{stop, {unexpected_msg, Msg}, State}.
View
14 src/rabbit_routing_util.erl
@@ -106,7 +106,10 @@ ensure_endpoint(_, Channel, {queue, Name}, Params, State) ->
#'queue.declare'{queue = Queue,
nowait = true},
queue, Params1),
- amqp_channel:cast(Channel, Method),
+ case Method#'queue.declare'.nowait of
+ true -> amqp_channel:cast(Channel, Method);
+ false -> amqp_channel:call(Channel, Method)
+ end,
sets:add_element(Queue, State)
end,
{ok, Queue, State1};
@@ -185,6 +188,12 @@ update_queue_declare_auto_delete(Method, Params) ->
Val -> Method#'queue.declare'{auto_delete = Val}
end.
+update_queue_declare_nowait(Method, Params) ->
+ case proplists:get_value(nowait, Params) of
+ undefined -> Method;
+ Val -> Method#'queue.declare'{nowait = Val}
+ end.
+
queue_declare_method(#'queue.declare'{} = Method, Type, Params) ->
%% defaults
Method1 = case proplists:get_value(durable, Params, false) of
@@ -196,7 +205,8 @@ queue_declare_method(#'queue.declare'{} = Method, Type, Params) ->
Method2 = lists:foldl(fun (F, Acc) -> F(Acc, Params) end,
Method1, [fun update_queue_declare_arguments/2,
fun update_queue_declare_exclusive/2,
- fun update_queue_declare_auto_delete/2]),
+ fun update_queue_declare_auto_delete/2,
+ fun update_queue_declare_nowait/2]),
case {Type, proplists:get_value(subscription_queue_name_gen, Params)} of
{topic, SQNG} when is_function(SQNG) ->
Method2#'queue.declare'{queue = SQNG()};
Please sign in to comment.
Something went wrong with that request. Please try again.