99namespace Magento \WebapiAsync \Code \Generator \Config \RemoteServiceReader ;
1010
1111use Magento \AsynchronousOperations \Model \ConfigInterface as WebApiAsyncConfig ;
12+ use Magento \Framework \App \ObjectManager ;
13+ use Magento \Framework \MessageQueue \DefaultValueProvider ;
1214
1315/**
1416 * Remote service reader with auto generated configuration for queue_publisher.xml
@@ -20,15 +22,26 @@ class Publisher implements \Magento\Framework\Config\ReaderInterface
2022 */
2123 private $ webapiAsyncConfig ;
2224
25+ /**
26+ * Default value provider.
27+ *
28+ * @var DefaultValueProvider
29+ */
30+ private $ defaultValueProvider ;
31+
2332 /**
2433 * Initialize dependencies.
2534 *
2635 * @param WebApiAsyncConfig $webapiAsyncConfig
36+ * @param DefaultValueProvider|null $defaultValueProvider
2737 */
2838 public function __construct (
29- WebApiAsyncConfig $ webapiAsyncConfig
39+ WebApiAsyncConfig $ webapiAsyncConfig ,
40+ DefaultValueProvider $ defaultValueProvider = null
3041 ) {
3142 $ this ->webapiAsyncConfig = $ webapiAsyncConfig ;
43+ $ this ->defaultValueProvider = $ defaultValueProvider
44+ ?? ObjectManager::getInstance ()->get (DefaultValueProvider::class);
3245 }
3346
3447 /**
@@ -49,8 +62,8 @@ public function read($scope = null)
4962 'topic ' => $ topicName ,
5063 'disabled ' => false ,
5164 'connections ' => [
52- ' amqp ' => [
53- 'name ' => ' amqp ' ,
65+ $ this -> defaultValueProvider -> getConnection () => [
66+ 'name ' => $ this -> defaultValueProvider -> getConnection () ,
5467 'exchange ' => 'magento ' ,
5568 'disabled ' => false ,
5669 ],
0 commit comments