This repository has been archived by the owner on May 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOroMessageQueueBundle.php
53 lines (48 loc) · 2.95 KB
/
OroMessageQueueBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Oro\Bundle\MessageQueueBundle;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\AddTopicMetaPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\BuildDestinationMetaRegistryPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\BuildExtensionsPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\BuildMessageProcessorRegistryPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\BuildMessageToArrayConverterPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\BuildRouteRegistryPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\BuildTopicMetaSubscribersPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\ConfigureClearersPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\ConfigureDbalTransportExtensionsPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\MakeAnnotationReaderServicesPersistentPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\Compiler\MakeLoggerServicesPersistentPass;
use Oro\Bundle\MessageQueueBundle\DependencyInjection\OroMessageQueueExtension;
use Oro\Component\MessageQueue\DependencyInjection\DbalTransportFactory;
use Oro\Component\MessageQueue\DependencyInjection\DefaultTransportFactory;
use Oro\Component\MessageQueue\DependencyInjection\NullTransportFactory;
use Oro\Component\MessageQueue\Job\Topics;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class OroMessageQueueBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new ConfigureDbalTransportExtensionsPass());
$container->addCompilerPass(new BuildExtensionsPass());
$container->addCompilerPass(new BuildRouteRegistryPass());
$container->addCompilerPass(new BuildMessageProcessorRegistryPass());
$container->addCompilerPass(new BuildTopicMetaSubscribersPass());
$container->addCompilerPass(new BuildDestinationMetaRegistryPass());
$container->addCompilerPass(new BuildMessageToArrayConverterPass());
$container->addCompilerPass(new ConfigureClearersPass());
$container->addCompilerPass(new MakeLoggerServicesPersistentPass());
$container->addCompilerPass(new MakeAnnotationReaderServicesPersistentPass());
/** @var OroMessageQueueExtension $extension */
$extension = $container->getExtension('oro_message_queue');
$extension->addTransportFactory(new DefaultTransportFactory());
$extension->addTransportFactory(new NullTransportFactory());
$extension->addTransportFactory(new DbalTransportFactory());
$addTopicPass = AddTopicMetaPass::create()
->add(Topics::CALCULATE_ROOT_JOB_STATUS, 'Calculate root job status')
->add(Topics::ROOT_JOB_STOPPED, 'Root job stopped');
$container->addCompilerPass($addTopicPass);
}
}