Cookbook 5.6.0 does not work with RabbitMQ 3.1.5
opened this issue · comments
I encounter connection errors (Connection reset by peer) when establishing an AMQP session with RabbitMQ 3.1.5 with configuration generated by rabbitmq cookbook 5.6.0. No problems are encountered with rabbitmq cookbook 2.1.3.
This is not a big surprise because RabbitMQ 3.1.5 is an ancient version. I'm only using it because I have to support an equally ancient application that is incompatible with RabbitMQ 3.2.0 and newer.
Until recently I was using rabbitmq cookbook 2.1.3 which generated a very simple configuration file that looks like this.
[
{rabbit, [
{default_user, <<"guest">>},
{default_pass, <<"guest">>}
]}
].
In contrast, the new rabbitmq cookbook 5.6.0 generates a more verbose configuration file. There's something about this config file that causes trouble with RabbitMQ 3.1.5.
[
{kernel, [
]},
{rabbitmq_management, [
{listener, [
{port, 15672}
]}
]},
{rabbit, [
{tcp_listeners, [5672]},
{tcp_listen_options, [{packet, raw},
{reuseaddr, true},
{backlog, 128},
{nodelay, true},
{exit_on_close, false},
{keepalive, false},
{linger, {true,0}}]},
{log_levels, [{ connection, info }]},
{default_user, <<"guest">>},
{default_pass, <<"guest">>},
{heartbeat, 60}
]}
].
So I'm left with a couple questions:
- What is the newest version of the rabbitmq cookbook that still works with RabbitMQ 3.1.5?
- What is the oldest version of RabbitMQ that this cookbook currently supports? (Related: Did the the RabbitMQ config file format change significantly, and if so, in which version?)
Ideally I would like to identify exactly where compatibility breaks and mention that in the Changelog for this cookbook.
--
Additional information:
- Ubuntu 14.04.1 LTS
- Erlang R16B03
Testing in my environment indicates that the client application only works when tcp_listen_options is configured with the binary
flag. It's not clear to me what the purpose of this flag is.
The ability to configure tcp_listen_options was added way back in RabbitMQ 2.4.0.
This cookbook introduced tcp_listen_options
in v2.3.0. But it was much more recently, in v5.6.0, that the binary
flag was removed. Why was that done?
Update: I have confirmed that cookbook 5.5.0 works just fine with RabbitMQ 3.1.5, and that removal of the binary
flag from tcp_listen_options
in 5.6.0 was the apparent cause of the problem.
- RabbitMQ 3.1.x has been out of any kind of support for years.
binary
is the default in Ranch, the TCP listener library adopted over 2 years ago in 3.6.0.
binary
was also default prior to Ranch (3.6.0) but it appears that including tcp_listen_options in RabbitMQ config pre-Ranch overrides the default options. So it seems that when this cookbook 5.6.0 is used with RabbitMQ 3.5, it's changing the behaviour to not be in binary
mode any more. (What is the other mode called, btw?)
Since this cookbook still advertises support for RabbitMQ 3.5.x in the README, I think it would be prudent to do one of two things:
- Restore the original behaviour for RabbitMQ 3.5 by re-adding the
binary
flag, or - Add a note in the Changelog to say that behaviour has changed for RabbitMQ 3.5 and older
The other mode is called list
.
5.6.1
is already out.