Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookbook 5.6.0 does not work with RabbitMQ 3.1.5 #488

Closed
ghost opened this issue Mar 1, 2018 · 4 comments
Closed

Cookbook 5.6.0 does not work with RabbitMQ 3.1.5 #488

ghost opened this issue Mar 1, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 1, 2018

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
@ghost ghost changed the title Cookbook 5.6 does not work with RabbitMQ 3.1.5 Cookbook 5.6.0 does not work with RabbitMQ 3.1.5 Mar 1, 2018
@ghost
Copy link
Author

ghost commented Mar 1, 2018

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.

ghost referenced this issue Mar 1, 2018
@michaelklishin
Copy link
Member

michaelklishin commented Mar 1, 2018

  1. RabbitMQ 3.1.x has been out of any kind of support for years.
  2. binary is the default in Ranch, the TCP listener library adopted over 2 years ago in 3.6.0.

@ghost
Copy link
Author

ghost commented Mar 1, 2018

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

@michaelklishin
Copy link
Member

The other mode is called list.

5.6.1 is already out.

@michaelklishin michaelklishin added this to the 5.6.1 milestone Mar 1, 2018
michaelklishin added a commit that referenced this issue Mar 1, 2018
To support versions older than 3.6.0 which are, ahem,
out of any kind of support.

Ranch, a TCP acceptor library adopted in 3.6.0,
forces binary and a few other TCP listener options.

Closes #488.

(cherry picked from commit 1aa9dc4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant