Skip to content

Conversation

@kierate
Copy link

@kierate kierate commented Aug 17, 2016

When using RabbitMQ with a load balancer in front of multiple nodes, the load balancer will close any connection that has not received messages (i.e. are considered inactive) after a certain period of time (e.g. 60 seconds). This issue can easily be solved (since php-amqplib v2.4.1) simply by providing the heartbeat and read_write_timeout options when constructing the connection object.

This PR essentially exposes those parameters, so they can be configured configured as part of Tail settings.

On top of heartbeat and read_write_timeout this PR also allows configuring keepalive, read_write_timeout and ssl_context_options (these are not necessary for enabling heartbeats, but are also just parameters to the AMQPStreamConnection constructor).

The Connection class now uses AMQPSSLConnection because:

  • it extends AMQPStreamConnection (same as AMQPConnection)
  • it provides default values for AMQPStreamConnection (so Tail does not need to care about backwards compatibility for the new settings)
  • when ssl_context_options are not provided it does not use SSL (behaves the same as AMQPConnection previously did)
  • when ssl_context_options are not provided it deals with creating the SSL context (so Tail doesn't have to)

@mookofe mookofe merged commit e46b179 into mookofe:master Mar 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants