Allow configuring additional connection options #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
heartbeatandread_write_timeoutoptions when constructing the connection object.This PR essentially exposes those parameters, so they can be configured configured as part of
Tailsettings.On top of
heartbeatandread_write_timeoutthis PR also allows configuringkeepalive,read_write_timeoutandssl_context_options(these are not necessary for enabling heartbeats, but are also just parameters to theAMQPStreamConnectionconstructor).The
Connectionclass now usesAMQPSSLConnectionbecause:AMQPStreamConnection(same asAMQPConnection)AMQPStreamConnection(soTaildoes not need to care about backwards compatibility for the new settings)ssl_context_optionsare not provided it does not use SSL (behaves the same asAMQPConnectionpreviously did)ssl_context_optionsare not provided it deals with creating the SSL context (soTaildoesn't have to)