Closed dorianyah closed 5 years ago
Hi.
Thanks for this bug report. Could we have more information?
Regarding the heartbeat configuration with pecl it looks like it's not perfectly implemented: (See https://github.com/pdezwart/php-amqp/blob/master/stubs/AMQPConnection.php#L42-L44).
It looks like it's used only when using blocking call. As we do not use the consume
method in the current swarrot implementation it probably won't change anything to specify a heartbeat configuration.
Hi,
Thanks for the fast feedback.
Answers to your 3 questions :
Here is the essential part of our HaProxy configuration, we are using timeout of 10 seconds
defaults
timeout connect 10s
timeout client 10s
timeout server 10s
We are experiencing that while publishing. We are using a daemon that publish messages on a irregular basis. But because the connection is established once at the first "publishing", it is closed when no messages are sent for more than the "10s defined timeout". We then noticed a crash of the script with this exception : "[Error] Library error: a socket error occured" "[Error] Could not publish to exchange. No channel available"
We understood that sending heartbeats could maintain a TCP connection opened during a certain amount of time to keep some TCP activity and to prevent the connexion to be closed by a proxy.
We first thought of implementing a reconnection pattern, but as the heartbeat seems to be a core feature of the AMQP protocol, we were interested in using it.
Thanks for any insight
Thanks, that's perfectly clear!
As mention in the documentation I gave previously, I doubt you'll solve your problem with the heartbeat implementation provided by the pecl extension.
Anyway, don't hesitate to make a PR to support this option in the bundle. You should only need to update the PeclFactory
to update your connection if a heartbeat is specified (in the url maybe?).
2 others solutions you should consider:
Edit : Thanks, we will investigate this.
Hi,
Here is our stack :
Our problem
Thanks