22
33namespace ReputationVIP \Bundle \QueueClientBundle ;
44
5+ use Psr \Log \LoggerInterface ;
56use ReputationVIP \Bundle \QueueClientBundle \Configuration \QueuesConfiguration ;
67use ReputationVIP \QueueClient \Adapter \AdapterInterface ;
8+ use ReputationVIP \QueueClient \Adapter \Exception \QueueAccessException ;
79use ReputationVIP \QueueClient \QueueClient ;
810use ReputationVIP \QueueClient \QueueClientInterface ;
911use Symfony \Component \Config \Definition \Processor ;
@@ -42,6 +44,8 @@ public static function resolveParameters(&$item, $key, $container)
4244 */
4345 public function get ($ container , $ adapter , $ queuesFile )
4446 {
47+ /** @var LoggerInterface $logger */
48+ $ logger = $ container ->get ('logger ' );
4549 $ queueClient = new QueueClient ($ adapter );
4650 $ processor = new Processor ();
4751 $ configuration = new QueuesConfiguration ();
@@ -53,6 +57,8 @@ public function get($container, $adapter, $queuesFile)
5357 foreach ($ queue [QueuesConfiguration::QUEUE_ALIASES_NODE ] as $ alias ) {
5458 try {
5559 $ queueClient ->addAlias ($ queueName , $ alias );
60+ } catch (QueueAccessException $ e ) {
61+ $ logger ->warning ($ e ->getMessage ());
5662 } catch (\ErrorException $ e ) {
5763 if ($ e ->getSeverity () === E_ERROR ) {
5864 throw $ e ;
0 commit comments