@@ -353,13 +353,19 @@ protected function loadBatchConsumers()
353
353
{
354
354
foreach ($ this ->config ['batch_consumers ' ] as $ key => $ consumer ) {
355
355
$ definition = new Definition ('%old_sound_rabbit_mq.batch_consumer.class% ' );
356
+
357
+ if (!isset ($ consumer ['exchange_options ' ])) {
358
+ $ consumer ['exchange_options ' ] = $ this ->getDefaultExchangeOptions ();
359
+ }
360
+
356
361
$ definition
357
362
->addTag ('old_sound_rabbit_mq.base_amqp ' )
358
- ->addTag ('old_sound_rabbit_mq.consumer ' )
359
363
->addTag ('old_sound_rabbit_mq.batch_consumer ' )
360
364
->addMethodCall ('setTimeoutWait ' , array ($ consumer ['timeout_wait ' ]))
361
365
->addMethodCall ('setPrefetchCount ' , array ($ consumer ['qos_options ' ]['prefetch_count ' ]))
366
+ ->addMethodCall ('setBatchCallback ' , array (array (new Reference ($ consumer ['callback ' ]), 'batchExecute ' )))
362
367
->addMethodCall ('setExchangeOptions ' , array ($ this ->normalizeArgumentKeys ($ consumer ['exchange_options ' ])))
368
+ ->addMethodCall ('setQueueOptions ' , array ($ this ->normalizeArgumentKeys ($ consumer ['queue_options ' ])))
363
369
->addMethodCall ('setCallback ' , array (array (new Reference ($ consumer ['callback ' ]), 'execute ' )))
364
370
->addMethodCall ('setQosOptions ' , array (
365
371
$ consumer ['qos_options ' ]['prefetch_size ' ],
@@ -385,8 +391,7 @@ protected function loadBatchConsumers()
385
391
$ this ->injectLogger ($ definition );
386
392
}
387
393
388
- $ name = sprintf ('old_sound_rabbit_mq.%s_batch ' , $ key );
389
- $ this ->container ->setDefinition ($ name , $ definition );
394
+ $ this ->container ->setDefinition (sprintf ('old_sound_rabbit_mq.%s_batch ' , $ key ), $ definition );
390
395
}
391
396
}
392
397
0 commit comments