HomePhabricator
Diffusion Comm 3f673de2b9e4

[services] Tunnelbroker - Wrap `connect()` into `init()` in AmqpManager

Description

[services] Tunnelbroker - Wrap connect() into init() in AmqpManager

Summary:
This diff is a part of the stack.

This diff introduces changes to move the creation of the internal thread for the AMQP client inside the init() function instead of using it outside and repeating the code in the main server.cpp and AMQP tests in test/AmqpManagerTest.cpp because of we need to initialize AMQP thread and connection on tests too.

Creating init() function following the existing approach that AWS-CPP client already uses. We are callinginit() to initialize AWS thread/client.

Related linear task: ENG-1495

Test Plan:

  1. Successfully built using yarn run-tunnelbroker-service-in-sandbox command.
  1. Passing all AMQP unit tests in the last diff in a stack D4768. Switch to D4768 and run yarn run-unit-tests tunnelbroker. The tests will pass.

Reviewers: karol, tomek

Reviewed By: tomek

Subscribers: ashoat, tomek, adrian, atul, karol, abosh

Differential Revision: https://phab.comm.dev/D4740