astarte-platform / astarte

Core Astarte Repository
https://docs.astarte-platform.org/
Apache License 2.0
238 stars 46 forks source link

DUP: stop custom handling of AMQP connections #895

Closed Annopaolo closed 7 months ago

Annopaolo commented 7 months ago

AMQPDataConsumer leaked channels when the process did not terminate correctly. Replace the ad-hoc handling of connections and channels with the ExRabbitPool pooling library. Contexually, add an env var to customize the number of connections to the broker:

As DUP is still using one channel per queue, the number of channels per connection is explicitly computed as ⎡total_queue_number/DATA_UPDATER_PLANT_AMQP_CONSUMER_CONNECTION_NUMBER⎤.

codecov[bot] commented 7 months ago

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (d79263b) 67.49% compared to head (b57bf46) 67.51%. Report is 3 commits behind head on release-1.1.

Files Patch % Lines
...b/astarte_data_updater_plant/amqp_data_consumer.ex 42.50% 23 Missing :warning:
...astarte_data_updater_plant/amqp_events_producer.ex 52.17% 11 Missing :warning:
...ter_plant/lib/astarte_data_updater_plant/config.ex 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## release-1.1 #895 +/- ## =============================================== + Coverage 67.49% 67.51% +0.02% =============================================== Files 264 263 -1 Lines 6439 6434 -5 =============================================== - Hits 4346 4344 -2 + Misses 2093 2090 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.