Avoid unnecessary RabbitMQ plugins from being started
Stomp and MQTT plugins were started on my machine and caused port collisions when I started the second rabbit for testing.
These plugins are not needed for the tests, so we can simply skip them.
MODIFY
Rakefile
Rakefile
@@ -30,13 +30,15 @@ namespace :rabbit do
# on my machine, the rabbitmq user is not be allowed to access my files.
# so we need to put the config file under /tmp
config_file = "/tmp/beetle-testing-rabbitmq-#{node_name}"
-
create_config_file config_file, web_port
+ enabled_plugins_file = "/tmp/beetle-testing-rabbitmq-enabled-plugins-#{node_name}"
+ create_enabled_plugins_file enabled_plugins_file
+
puts "starting rabbit #{node_name} on port #{port}, web management port #{web_port}"
puts "type ^C a RETURN to abort"
sleep 1
- exec "sudo #{script} #{node_name} #{port} #{config_file}"
+ exec "sudo #{script} #{node_name} #{port} #{config_file} #{enabled_plugins_file}"
end
def create_config_file(config_file, web_port)
@@ -48,6 +50,12 @@ namespace :rabbit do
end
end
+ def create_enabled_plugins_file(enabled_plugins_file)
+ File.open("#{enabled_plugins_file}",'w') do |f|
+ f.puts "[rabbitmq_management]."
+ end
+ end
+
desc "start rabbit instance 1"
task :start1 do
start "rabbit1", 5672, 15672

MODIFY
script/start_rabbit
script/start_rabbit
@@ -26,7 +26,9 @@ export RABBITMQ_CONFIG_FILE=$3
# Defaults to /etc/rabbitmq/rabbitmq_cluster.config. If this file is present it
# is used by the server to auto-configure a RabbitMQ cluster. See the clustering
# guide at <http://www.rabbitmq.com/clustering.html> for details.
+export RABBITMQ_ENABLED_PLUGINS_FILE=$4
rabbitmq-server
rm -f $RABBITMQ_CONFIG_FILE
+rm -f $RABBITMQ_ENABLED_PLUGINS_FILE

Avoid unnecessary RabbitMQ plugins from being started

Stomp and MQTT plugins were started on my machine and caused port collisions when I started the second rabbit for testing.
These plugins are not needed for the tests, so we can simply skip them.