This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree 2 files changed +7
-3
lines changed
lib/internal/Magento/Framework/Communication/Config
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -130,15 +130,16 @@ protected function extractTopics($config)
130
130
$ topicName ,
131
131
$ serviceMethod [ConfigParser::TYPE_NAME ],
132
132
$ serviceMethod [ConfigParser::METHOD_NAME ],
133
- $ handlers
133
+ $ handlers ,
134
+ $ isSynchronous
134
135
);
135
136
} elseif ($ requestSchema && $ responseSchema ) {
136
137
$ output [$ topicName ] = [
137
138
Config::TOPIC_NAME => $ topicName ,
138
139
Config::TOPIC_IS_SYNCHRONOUS => $ isSynchronous ?? true ,
139
140
Config::TOPIC_REQUEST => $ requestSchema ,
140
141
Config::TOPIC_REQUEST_TYPE => Config::TOPIC_REQUEST_TYPE_CLASS ,
141
- Config::TOPIC_RESPONSE => $ responseSchema ,
142
+ Config::TOPIC_RESPONSE => ( $ isSynchronous ) ? $ responseSchema: null ,
142
143
Config::TOPIC_HANDLERS => $ handlers
143
144
];
144
145
} elseif ($ requestSchema ) {
Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ public function generateTopicConfigForServiceMethod(
81
81
$ returnType = ($ returnType != 'void ' && $ returnType != 'null ' ) ? $ returnType : null ;
82
82
if (!isset ($ isSynchronous )) {
83
83
$ isSynchronous = $ returnType ? true : false ;
84
+ } else {
85
+ $ returnType = ($ isSynchronous ) ? $ returnType : null ;
84
86
}
85
87
return [
86
88
Config::TOPIC_NAME => $ topicName ,
@@ -89,12 +91,13 @@ public function generateTopicConfigForServiceMethod(
89
91
Config::TOPIC_REQUEST_TYPE => Config::TOPIC_REQUEST_TYPE_METHOD ,
90
92
Config::TOPIC_RESPONSE => $ returnType ,
91
93
Config::TOPIC_HANDLERS => $ handlers
92
- ? : [self ::DEFAULT_HANDLER => $ methodMetadata [Config::SCHEMA_METHOD_HANDLER ]]
94
+ ?: [self ::DEFAULT_HANDLER => $ methodMetadata [Config::SCHEMA_METHOD_HANDLER ]]
93
95
];
94
96
}
95
97
96
98
/**
97
99
* Generate topic name based on service type and method name.
100
+ *
98
101
* Perform the following conversion:
99
102
* \Magento\Customer\Api\RepositoryInterface + getById =>
100
103
* magento.customer.api.repositoryInterface.getById
You can’t perform that action at this time.
0 commit comments