Skip to content

Commit

Permalink
[MessageQueue]: updated topology schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolan-Arnold committed Oct 27, 2020
1 parent 61146b7 commit 7b096aa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function validate($configData)
else{
$diff = array_diff($requiredQueueFields, array_keys($data));
foreach ($diff as $field) {
$errors[] = sprintf('Really Missing [%s] field for queue %s.', $field, $name);
$errors[] = sprintf('Missing [%s] field for queue %s.', $field, $name);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ public function convert($source)
];
}

foreach ($source->getElementsByTagName('queue') as $exchange) {
$name = $this->getAttributeValue($exchange, 'name');
$connection = $this->getAttributeValue($exchange, 'connection');
foreach ($source->getElementsByTagName('queue') as $queue) {
$name = $this->getAttributeValue($queue, 'name');
$connection = $this->getAttributeValue($queue, 'connection');

$bindings = [];
$exchangeArguments = [];
$queueArguments = [];
/** @var \DOMNode $node */
foreach ($exchange->childNodes as $node) {
foreach ($queue->childNodes as $node) {
if (!in_array($node->nodeName, ['binding', 'arguments']) || $node->nodeType != XML_ELEMENT_NODE) {
continue;
}
Expand All @@ -117,20 +117,20 @@ public function convert($source)
break;

case 'arguments':
$exchangeArguments = $this->processArguments($node);
$queueArguments = $this->processArguments($node);
break;
}
}

$autoDelete = $this->getAttributeValue($exchange, 'autoDelete', false);
$autoDelete = $this->getAttributeValue($queue, 'autoDelete', false);
$result[$name . '--' . $connection] = [
'name' => $name,
'type' => $this->getAttributeValue($exchange, 'type'),
'type' => $this->getAttributeValue($queue, 'type'),
'connection' => $connection,
'durable' => $this->booleanUtils->toBoolean($this->getAttributeValue($exchange, 'durable', true)),
'durable' => $this->booleanUtils->toBoolean($this->getAttributeValue($queue, 'durable', true)),
'autoDelete' => $this->booleanUtils->toBoolean($autoDelete),
'internal' => $this->booleanUtils->toBoolean($this->getAttributeValue($exchange, 'internal', false)),
'arguments' => $exchangeArguments,
'internal' => $this->booleanUtils->toBoolean($this->getAttributeValue($queue, 'internal', false)),
'arguments' => $queueArguments,
];
}

Expand Down
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/MessageQueue/etc/topology.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

<xs:element name="config">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element type="exchangeConfigType" name="exchange" maxOccurs="unbounded" minOccurs="0">
<xs:unique name="unique-binding-id">
<xs:annotation>
Expand All @@ -75,7 +75,7 @@
</xs:unique>
</xs:element>
<xs:element type="queueConfigType" name="queue" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:choice>
</xs:complexType>
<xs:unique name="unique-exchange-name-connection">
<xs:annotation>
Expand Down

0 comments on commit 7b096aa

Please sign in to comment.