@@ -53,7 +53,7 @@ public function load(array $configs, ContainerBuilder $container): void
53
53
// transport & consumption
54
54
$ transportNames [] = $ name ;
55
55
56
- $ transportFactory = (new TransportFactory ($ name ));
56
+ $ transportFactory = (new TransportFactory ($ name, $ defaultName === $ name ));
57
57
$ transportFactory ->buildConnectionFactory ($ container , $ configs ['transport ' ]);
58
58
$ transportFactory ->buildContext ($ container , []);
59
59
$ transportFactory ->buildQueueConsumer ($ container , $ configs ['consumption ' ]);
@@ -68,8 +68,8 @@ public function load(array $configs, ContainerBuilder $container): void
68
68
$ clientConfig ['transport ' ] = $ configs ['transport ' ];
69
69
$ clientConfig ['consumption ' ] = $ configs ['consumption ' ];
70
70
71
- $ clientFactory = new ClientFactory ($ name );
72
- $ clientFactory ->build ($ container , $ clientConfig, $ defaultName === $ name );
71
+ $ clientFactory = new ClientFactory ($ name, $ defaultName === $ name );
72
+ $ clientFactory ->build ($ container , $ clientConfig );
73
73
$ clientFactory ->createDriver ($ container , $ configs ['transport ' ]);
74
74
$ clientFactory ->createFlushSpoolProducerListener ($ container );
75
75
}
@@ -97,6 +97,18 @@ public function load(array $configs, ContainerBuilder $container): void
97
97
98
98
$ loader ->load ('job.yml ' );
99
99
}
100
+
101
+ // async events
102
+ if (false == empty ($ config ['async_events ' ]['enabled ' ])) {
103
+ if ($ name !== $ defaultName ) {
104
+ throw new \LogicException ('Async events supports only default configuration. ' );
105
+ }
106
+
107
+ $ extension = new AsyncEventDispatcherExtension ();
108
+ $ extension ->load ([[
109
+ 'context_service ' => 'enqueue.transport.default.context ' ,
110
+ ]], $ container );
111
+ }
100
112
}
101
113
102
114
$ defaultClient = null ;
@@ -125,17 +137,6 @@ public function load(array $configs, ContainerBuilder $container): void
125
137
$ this ->loadDoctrineClearIdentityMapExtension ($ config , $ container );
126
138
$ this ->loadSignalExtension ($ config , $ container );
127
139
$ this ->loadReplyExtension ($ config , $ container );
128
-
129
- // if ($config['async_events']['enabled']) {
130
- // if (false == class_exists(AsyncEventDispatcherExtension::class)) {
131
- // throw new \LogicException('The "enqueue/async-event-dispatcher" package has to be installed.');
132
- // }
133
- //
134
- // $extension = new AsyncEventDispatcherExtension();
135
- // $extension->load([[
136
- // 'context_service' => 'enqueue.transport.default.context',
137
- // ]], $container);
138
- // }
139
140
}
140
141
141
142
public function getConfiguration (array $ config , ContainerBuilder $ container ): Configuration
0 commit comments