Skip to content

Commit

Permalink
Merge pull request #105 from kmfk/fix-sns-confirmations
Browse files Browse the repository at this point in the history
Fix for SNS subscription confirmations
  • Loading branch information
k-k authored Jun 30, 2016
2 parents ac8b279 + cebeee7 commit 2b7ee86
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/DependencyInjection/UecodeQPushExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ public function load(array $configs, ContainerBuilder $container)
$class, [$queue, $values['options'], $client, new Reference($cache), new Reference('logger')]
);

$name = sprintf('uecode_qpush.%s', $queue);

$container->setDefinition($name, $definition)
->addTag('monolog.logger', ['channel' => 'qpush'])
$definition->addTag('monolog.logger', ['channel' => 'qpush'])
->addTag(
'uecode_qpush.event_listener',
[
Expand All @@ -113,8 +110,23 @@ public function load(array $configs, ContainerBuilder $container)
'method' => "onMessageReceived",
'priority' => -255
]
)
;
);

if (!empty($values['options']['queue_name'])
&& $config['providers'][$provider]['driver'] == 'aws'
) {
$definition->addTag(
'uecode_qpush.event_listener',
[
'event' => "{$values['options']['queue_name']}.on_notification",
'method' => "onNotification",
'priority' => 255
]
);
}

$name = sprintf('uecode_qpush.%s', $queue);
$container->setDefinition($name, $definition);

$registry->addMethodCall('addProvider', [$queue, new Reference($name)]);
}
Expand Down

0 comments on commit 2b7ee86

Please sign in to comment.