bloomberg / amqpprox

An AMQP 0.9.1 proxy server, designed for use in front of an AMQP 0.9.1 compliant message queue broker such as RabbitMQ.
Apache License 2.0
78 stars 16 forks source link

Disconnect or resume unpaused connections #75

Closed adamncasey closed 2 years ago

adamncasey commented 2 years ago

VHOST UNPAUSE <vhost-name> right now only permits new connections to a particularly vhost. Existing, paused, connections are left alone. This isn't exactly a problem because we are aware of this and specifically run FORCE_DISCONNECT where we want connections to be re-established, and heartbeats generally trigger clients to reconnect.

This patch changes the unpause behaviour:

  1. Connections paused before the broker connection is established will be resumed without a client disconnect being required.

  2. Connections paused with an open broker connection are disconnected.

Once these changes are active (specifically the first change) we can stop doing a second FORCE_DISCONNECT during a vhost migration:

VHOST PAUSE vhost-name
VHOST FORCE_DISCONNECT vhost-name
MAP FARM vhost-name <new-broker-farm>
VHOST UNPAUSE vhost-name
VHOST FORCE_DISCONNECT vhost-name

This is a minor improvement in migration performance / client experience. It also clarifies the meaning of UNPAUSE - the current behaviour is a little surprising.

Looks like these changes are being affected by a clang-format upgrade. I'll put a separate PR up for the whole project too.

adamncasey commented 2 years ago

Clang format changes went away after #76