summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ebin/rabbit_app.in14
-rw-r--r--src/credit_flow.erl7
-rw-r--r--src/rabbit_queue_decorator.erl16
-rw-r--r--test/src/credit_flow_test.erl7
-rw-r--r--test/src/rabbit_tests.erl2
5 files changed, 34 insertions, 12 deletions
diff --git a/ebin/rabbit_app.in b/ebin/rabbit_app.in
index cd3516d32c..7c4be6f7f2 100644
--- a/ebin/rabbit_app.in
+++ b/ebin/rabbit_app.in
@@ -85,9 +85,15 @@
{ssl_apps, [asn1, crypto, public_key, ssl]},
%% see rabbitmq-server#114
{mirroring_flow_control, true},
- {credit_flow_initial_credit, 200},
- {credit_flow_more_credit_after, 50},
- %% see rabbitmq-server#227 and related tickets
+ %% see rabbitmq-server#227 and related tickets.
+ %% msg_store_credit_disc_bound only takes effect when
+ %% messages are persisted to the message store. If messages
+ %% are embedded on the queue index, then modifying this
+ %% setting has no effect because credit_flow is not used when
+ %% writing to the queue index. See the setting
+ %% queue_index_embed_msgs_below above.
{msg_store_credit_disc_bound, {2000, 500}},
- {msg_store_io_batch_size, 2048}
+ {msg_store_io_batch_size, 2048},
+ %% see rabbitmq-server#143
+ {credit_flow_default_credit, {200, 50}}
]}]}.
diff --git a/src/credit_flow.erl b/src/credit_flow.erl
index d2f2355f03..02fd19620b 100644
--- a/src/credit_flow.erl
+++ b/src/credit_flow.erl
@@ -34,10 +34,9 @@
-define(DEFAULT_CREDIT,
case get(credit_flow_default_credit) of
undefined ->
- Val = {rabbit_misc:get_env(rabbit, credit_flow_initial_credit,
- ?DEFAULT_INITIAL_CREDIT),
- rabbit_misc:get_env(rabbit, credit_flow_more_credit_after,
- ?DEFAULT_MORE_CREDIT_AFTER)},
+ Val = rabbit_misc:get_env(rabbit, credit_flow_default_credit,
+ {?DEFAULT_INITIAL_CREDIT,
+ ?DEFAULT_MORE_CREDIT_AFTER}),
put(credit_flow_default_credit, Val),
Val;
Val -> Val
diff --git a/src/rabbit_queue_decorator.erl b/src/rabbit_queue_decorator.erl
index adfe0c7fae..129f51d099 100644
--- a/src/rabbit_queue_decorator.erl
+++ b/src/rabbit_queue_decorator.erl
@@ -1,3 +1,19 @@
+%% The contents of this file are subject to the Mozilla Public License
+%% Version 1.1 (the "License"); you may not use this file except in
+%% compliance with the License. You may obtain a copy of the License
+%% at http://www.mozilla.org/MPL/
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and
+%% limitations under the License.
+%%
+%% The Original Code is RabbitMQ.
+%%
+%% The Initial Developer of the Original Code is GoPivotal, Inc.
+%% Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved.
+%%
+
-module(rabbit_queue_decorator).
-include("rabbit.hrl").
diff --git a/test/src/credit_flow_test.erl b/test/src/credit_flow_test.erl
index db014888eb..4910da3db3 100644
--- a/test/src/credit_flow_test.erl
+++ b/test/src/credit_flow_test.erl
@@ -22,12 +22,11 @@ test_credit_flow_settings() ->
%% default values
passed = test_proc(200, 50),
- application:set_env(rabbit, credit_flow_initial_credit, 100),
- application:set_env(rabbit, credit_flow_more_credit_after, 20),
+ application:set_env(rabbit, credit_flow_default_credit, {100, 20}),
passed = test_proc(100, 20),
- application:unset_env(rabbit, credit_flow_initial_credit),
- application:unset_env(rabbit, credit_flow_more_credit_after),
+ application:unset_env(rabbit, credit_flow_default_credit),
+
% back to defaults
passed = test_proc(200, 50),
passed.
diff --git a/test/src/rabbit_tests.erl b/test/src/rabbit_tests.erl
index 98fe080627..57e250637d 100644
--- a/test/src/rabbit_tests.erl
+++ b/test/src/rabbit_tests.erl
@@ -93,6 +93,8 @@ all_tests0() ->
passed = credit_flow_test:test_credit_flow_settings(),
passed = on_disk_store_tunable_parameter_validation_test:test_msg_store_parameter_validation(),
passed = password_hashing_tests:test_password_hashing(),
+ passed = credit_flow_test:test_credit_flow_settings(),
+
passed.
do_if_secondary_node(Up, Down) ->