File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
app/code/Magento/WebapiAsync/Code/Generator/Config/RemoteServiceReader
dev/tests/integration/testsuite/Magento/ImportExport/Model/Export Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 9
9
namespace Magento \WebapiAsync \Code \Generator \Config \RemoteServiceReader ;
10
10
11
11
use Magento \AsynchronousOperations \Model \ConfigInterface as WebApiAsyncConfig ;
12
+ use Magento \Framework \App \ObjectManager ;
13
+ use Magento \Framework \MessageQueue \DefaultValueProvider ;
12
14
13
15
/**
14
16
* Remote service reader with auto generated configuration for queue_publisher.xml
15
17
*/
16
18
class Publisher implements \Magento \Framework \Config \ReaderInterface
17
19
{
18
-
19
20
/**
20
21
* @var WebApiAsyncConfig
21
22
*/
22
23
private $ webapiAsyncConfig ;
23
24
25
+ /**
26
+ * Default value provider.
27
+ *
28
+ * @var DefaultValueProvider
29
+ */
30
+ private $ defaultValueProvider ;
31
+
24
32
/**
25
33
* Initialize dependencies.
26
34
*
27
35
* @param WebApiAsyncConfig $webapiAsyncConfig
36
+ * @param DefaultValueProvider|null $defaultValueProvider
28
37
*/
29
38
public function __construct (
30
- WebApiAsyncConfig $ webapiAsyncConfig
39
+ WebApiAsyncConfig $ webapiAsyncConfig ,
40
+ DefaultValueProvider $ defaultValueProvider = null
31
41
) {
32
42
$ this ->webapiAsyncConfig = $ webapiAsyncConfig ;
43
+ $ this ->defaultValueProvider = $ defaultValueProvider
44
+ ?? ObjectManager::getInstance ()->get (DefaultValueProvider::class);
33
45
}
34
46
35
47
/**
@@ -50,8 +62,8 @@ public function read($scope = null)
50
62
'topic ' => $ topicName ,
51
63
'disabled ' => false ,
52
64
'connections ' => [
53
- ' amqp ' => [
54
- 'name ' => ' amqp ' ,
65
+ $ this -> defaultValueProvider -> getConnection () => [
66
+ 'name ' => $ this -> defaultValueProvider -> getConnection () ,
55
67
'exchange ' => 'magento ' ,
56
68
'disabled ' => false ,
57
69
],
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ protected function tearDown(): void
89
89
*/
90
90
public function testProcess (): void
91
91
{
92
- $ this -> objectManager -> get ( ' Psr\Log\LoggerInterface ' )-> info ( ' Amqp config ' . implode ( " " , $ this ->deploymentConfig ->get ('queue/amqp ' ) ));
92
+ echo " Deployment config for queue is: " . json_encode ( $ this ->deploymentConfig ->get ('queue ' ));
93
93
$ envelope = $ this ->queue ->dequeue ();
94
94
$ decodedMessage = $ this ->messageEncoder ->decode ('import_export.export ' , $ envelope ->getBody ());
95
95
$ this ->consumer ->process ($ decodedMessage );
You can’t perform that action at this time.
0 commit comments