cloudamqp / amqproxy

An intelligent AMQP proxy, with connection and channel pooling/reusing
https://www.cloudamqp.com
MIT License
351 stars 54 forks source link

New connections are generated for each request #93

Closed alxlapin closed 1 year ago

alxlapin commented 1 year ago

Hi! Probably, i don't understand mechanics of the proxy, because every time i connect to rabbit new connection and channel are created. For example, one active connection is present (first one on the screen), then i publish a message to a queue and see that new connection and channel is used for handling the request and after a few seconds they disappear (and i was thinking that active connection would be used). It would be much appreciated if someone clarified mechanics for me. Thanks!

image

P.S. docker containers are used for dev environment (php, rabbit, amqproxy). P.S.S. php-amqplib is used for communicating with rabbit/proxy.

carlhoerberg commented 1 year ago

The connection timeout for upstream connections is by default is 5s. So only if you create a new client connection within 5s from another connection has been closed will it be reused by the proxy.