-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathservices.yaml
More file actions
102 lines (78 loc) · 3.68 KB
/
services.yaml
File metadata and controls
102 lines (78 loc) · 3.68 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
imports:
- { resource: ../../../../src/Mooc/Shared/Infrastructure/Symfony/DependencyInjection/mooc_services.yaml }
services:
_defaults:
autoconfigure: true
autowire: true
# Configure
_instanceof:
CodelyTv\Shared\Domain\Bus\Event\DomainEventSubscriber:
tags: ['codely.domain_event_subscriber']
CodelyTv\Shared\Domain\Bus\Command\CommandHandler:
tags: ['codely.command_handler']
CodelyTv\Shared\Domain\Bus\Query\QueryHandler:
tags: ['codely.query_handler']
CodelyTv\Apps\Mooc\Backend\Controller\:
resource: '../src/Controller'
tags: ['controller.service_arguments']
CodelyTv\Apps\Mooc\Backend\Command\:
resource: '../src/Command'
tags: ['console.command']
# Wire
CodelyTv\Shared\:
resource: '../../../../src/Shared'
CodelyTv\Mooc\:
resource: '../../../../src/Mooc'
# -- TAGGING --
CodelyTv\Shared\Infrastructure\Bus\Event\InMemory\InMemorySymfonyEventBus:
arguments: [!tagged codely.domain_event_subscriber]
lazy: true
CodelyTv\Shared\Infrastructure\Bus\Event\DomainEventMapping:
arguments: [!tagged codely.domain_event_subscriber]
CodelyTv\Shared\Infrastructure\Bus\Event\DomainEventSubscriberLocator:
arguments: [!tagged codely.domain_event_subscriber]
CodelyTv\Shared\Infrastructure\Doctrine\DatabaseConnections:
arguments: [!tagged codely.database_connection]
CodelyTv\Shared\Infrastructure\Symfony\AddJsonBodyToRequestListener:
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
CodelyTv\Shared\Infrastructure\Symfony\ApiExceptionListener:
tags:
- { name: kernel.event_listener, event: kernel.exception, method: onException }
# -- APP DEFINITIONS --
# Command/Query Handlers
CodelyTv\Shared\Infrastructure\Bus\Command\InMemorySymfonyCommandBus:
arguments: [!tagged codely.command_handler]
CodelyTv\Shared\Infrastructure\Bus\Query\InMemorySymfonyQueryBus:
arguments: [!tagged codely.query_handler]
# RabbitMQ
CodelyTv\Shared\Infrastructure\Bus\Event\RabbitMq\RabbitMqConnection:
arguments:
- host: '%env(RABBITMQ_HOST)%'
port: '%env(RABBITMQ_PORT)%'
vhost: '%env(RABBITMQ_MOOC_VHOST)%'
login: '%env(RABBITMQ_LOGIN)%'
password: '%env(RABBITMQ_PASSWORD)%'
read_timeout: 2
write_timeout: 2
connect_timeout: 5
CodelyTv\Shared\Infrastructure\Bus\Event\RabbitMq\RabbitMqEventBus:
arguments: ['@CodelyTv\Shared\Infrastructure\Bus\Event\RabbitMq\RabbitMqConnection', '%env(RABBITMQ_EXCHANGE)%']
CodelyTv\Shared\Infrastructure\Bus\Event\RabbitMq\RabbitMqDomainEventsConsumer:
arguments:
- '@CodelyTv\Shared\Infrastructure\Bus\Event\RabbitMq\RabbitMqConnection'
- '@CodelyTv\Shared\Infrastructure\Bus\Event\DomainEventJsonDeserializer'
- '%env(RABBITMQ_EXCHANGE)%'
- '%env(RABBITMQ_MAX_RETRIES)%'
CodelyTv\Apps\Mooc\Backend\Command\DomainEvents\RabbitMq\ConfigureRabbitMqCommand:
arguments:
- '@CodelyTv\Shared\Infrastructure\Bus\Event\RabbitMq\RabbitMqConfigurer'
- '%env(RABBITMQ_EXCHANGE)%'
- !tagged codely.domain_event_subscriber
CodelyTv\Shared\Infrastructure\Bus\Event\WithMonitoring\WithPrometheusMonitoringEventBus:
arguments: ['@CodelyTv\Shared\Infrastructure\Monitoring\PrometheusMonitor', 'mooc_backend', '@CodelyTv\Shared\Infrastructure\Bus\Event\RabbitMq\RabbitMqEventBus']
# -- IMPLEMENTATIONS SELECTOR --
CodelyTv\Shared\Domain\Bus\Event\EventBus: '@CodelyTv\Shared\Infrastructure\Bus\Event\WithMonitoring\WithPrometheusMonitoringEventBus'
CodelyTv\Mooc\Notifications\Application\PublishInSocialMediaOnNewVideo:
arguments:
courseRepository: '@CodelyTv\Mooc\Courses\Infrastructure\Persistence'