ltsecurityinc安防产品在线商城代码
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\TestModuleMessageQueueConfiguration;
|
||||
|
||||
/**
|
||||
* Class for testing asynchronous queue handlers.
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class AsyncHandler
|
||||
{
|
||||
/**
|
||||
* @param string
|
||||
* @return void
|
||||
*/
|
||||
public function methodWithStringParam($param)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool
|
||||
* @return void
|
||||
*/
|
||||
public function methodWithBoolParam($param)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed
|
||||
* @return void
|
||||
*/
|
||||
public function methodWithMixedParam($param)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\TestModuleMessageQueueConfiguration;
|
||||
|
||||
/**
|
||||
* Class for testing queue handlers.
|
||||
*/
|
||||
class HandlerOne
|
||||
{
|
||||
/**
|
||||
* Return true.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function handlerMethodOne()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function handlerMethodTwo()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function handlerMethodThree()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\TestModuleMessageQueueConfiguration;
|
||||
|
||||
/**
|
||||
* Class for testing queue handlers.
|
||||
*/
|
||||
class HandlerTwo
|
||||
{
|
||||
/**
|
||||
* Return true.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function handlerMethodOne()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function handlerMethodTwo()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function handlerMethodThree()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\TestModuleMessageQueueConfiguration;
|
||||
|
||||
/**
|
||||
* Class for testing synchronous queue handlers.
|
||||
*/
|
||||
class SyncHandler
|
||||
{
|
||||
/**
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
public function methodWithStringParam($param)
|
||||
{
|
||||
return 'Processed: ' . $param;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool
|
||||
* @return bool
|
||||
*/
|
||||
public function methodWithBoolParam($param)
|
||||
{
|
||||
return !$param;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed
|
||||
* @return mixed
|
||||
*/
|
||||
public function methodWithMixedParam($param)
|
||||
{
|
||||
return $param;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "magento/module-test-module-message-queue-configuration",
|
||||
"description": "test module for message queue configuration",
|
||||
"require": {
|
||||
"php": "~7.4.0||~8.0.0",
|
||||
"magento/framework": "*",
|
||||
"magento/module-integration": "*"
|
||||
},
|
||||
"type": "magento2-module",
|
||||
"extra": {
|
||||
"map": [
|
||||
[
|
||||
"*",
|
||||
"Magento/TestModuleMessageQueueConfiguration"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Communication/etc/communication.xsd">
|
||||
<topic name="deprecated.config.async.bool.topic" request="bool">
|
||||
<handler name="handler1" type="Magento\TestModuleMessageQueueConfiguration\AsyncHandler" method="methodWithBoolParam"/>
|
||||
<handler name="handler2" type="Magento\TestModuleMessageQueueConfiguration\AsyncHandler" method="methodWithMixedParam"/>
|
||||
</topic>
|
||||
<topic name="deprecated.config.async.string.topic" request="string"/>
|
||||
<topic name="deprecated.config.sync.string.topic" request="string" response="string">
|
||||
<handler name="handler1" type="Magento\TestModuleMessageQueueConfiguration\SyncHandler" method="methodWithStringParam"/>
|
||||
</topic>
|
||||
<topic name="deprecated.config.sync.bool.topic" schema="Magento\TestModuleMessageQueueConfiguration\SyncHandler::methodWithBoolParam">
|
||||
<handler name="handler1" type="Magento\TestModuleMessageQueueConfiguration\SyncHandler" method="methodWithBoolParam"/>
|
||||
</topic>
|
||||
<topic name="overlapping.topic.declaration" request="string">
|
||||
<handler name="handler1" type="Magento\TestModuleMessageQueueConfiguration\AsyncHandler" method="methodWithStringParam"/>
|
||||
</topic>
|
||||
<topic name="anotherTopic1" request="string"/>
|
||||
<topic name="anotherTopic2" request="string"/>
|
||||
</config>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Magento_TestModuleMessageQueueConfiguration" >
|
||||
</module>
|
||||
</config>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/queue.xsd">
|
||||
<broker topic="deprecated.config.async.string.topic">
|
||||
<queue consumer="deprecatedConfigAsyncStringConsumer" name="deprecated.config.queue.1" consumerInstance="Magento\Framework\MessageQueue\BatchConsumer" maxMessages="200"/>
|
||||
<queue consumer="deprecatedConfigAsyncMixedConsumer" name="deprecated.config.queue.3" handler="Magento\TestModuleMessageQueueConfiguration\AsyncHandler::methodWithMixedParam"/>
|
||||
</broker>
|
||||
<broker topic="deprecated.config.async.bool.topic" type="db" exchange="deprecatedExchange">
|
||||
<queue consumer="deprecatedConfigAsyncBoolConsumer" name="deprecated.config.queue.2" />
|
||||
</broker>
|
||||
<broker topic="deprecated.config.sync.bool.topic" type="db" exchange="customExchange">
|
||||
<queue consumer="deprecatedConfigSyncBoolConsumer" name="deprecated.config.queue.4"/>
|
||||
</broker>
|
||||
<broker topic="overlapping.topic.declaration" exchange="overlappingDeprecatedExchange">
|
||||
<queue consumer="overlappingConsumerDeclaration" name="consumer.config.queue" consumerInstance="Magento\Framework\MessageQueue\BatchConsumer" maxMessages="222" handler="Magento\TestModuleMessageQueueConfiguration\AsyncHandler::methodWithMixedParam"/>
|
||||
</broker>
|
||||
</config>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/consumer.xsd">
|
||||
<consumer name="consumer1" queue="queue1" handler="Magento\TestModuleMessageQueueConfiguration\HandlerOne::handlerMethodOne" consumerInstance="Magento\Framework\MessageQueue\BatchConsumer" connection="amqp" maxMessages="100"/>
|
||||
<consumer name="consumer2" queue="queue2" handler="Magento\TestModuleMessageQueueConfiguration\HandlerOne::handlerMethodTwo" consumerInstance="Magento\Framework\MessageQueue\BatchConsumer" connection="db"/>
|
||||
<consumer name="consumer3" queue="queue3" handler="Magento\TestModuleMessageQueueConfiguration\HandlerTwo::handlerMethodOne" consumerInstance="Magento\Framework\MessageQueue\BatchConsumer"/>
|
||||
<consumer name="consumer4" queue="queue4" handler="Magento\TestModuleMessageQueueConfiguration\HandlerOne::handlerMethodOne"/>
|
||||
<consumer name="consumer5" queue="queue5"/>
|
||||
<consumer name="overlappingConsumerDeclaration" queue="consumer.config.queue" connection="amqp"/>
|
||||
</config>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
|
||||
<publisher topic="topic.message.queue.config.01">
|
||||
<connection name="amqp" exchange="magento2" />
|
||||
<connection name="db" exchange="magento2" disabled="true" />
|
||||
</publisher>
|
||||
<publisher topic="topic.message.queue.config.02">
|
||||
<connection name="amqp" exchange="magento2" disabled="true"/>
|
||||
<connection name="db" exchange="magento2" disabled="true" />
|
||||
</publisher>
|
||||
<publisher topic="topic.message.queue.config.03" disabled="true" />
|
||||
<publisher topic="topic.message.queue.config.04">
|
||||
<connection name="amqp" />
|
||||
</publisher>
|
||||
<publisher topic="overlapping.topic.declaration"/>
|
||||
</config>
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd">
|
||||
<exchange name="magento-topic-based-exchange1" type="topic" connection="amqp">
|
||||
<binding id="topicBasedRouting1" topic="anotherTopic1" destinationType="queue" destination="topic-queue1">
|
||||
<arguments>
|
||||
<argument name="argument1" xsi:type="string">value</argument>
|
||||
</arguments>
|
||||
</binding>
|
||||
</exchange>
|
||||
|
||||
<exchange name="magento-topic-based-exchange2" connection="amqp">
|
||||
<binding id="topicBasedRouting2" topic="anotherTopic2" destination="topic-queue2" destinationType="queue">
|
||||
<arguments>
|
||||
<argument name="argument1" xsi:type="string">value</argument>
|
||||
</arguments>
|
||||
</binding>
|
||||
<arguments>
|
||||
<argument name="arrayValue" xsi:type="array">
|
||||
<item name="element01" xsi:type="string">10</item>
|
||||
<item name="element02" xsi:type="string">20</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</exchange>
|
||||
|
||||
<exchange name="magento-topic-based-exchange3" type="topic" connection="amqp" autoDelete="true" durable="false" internal="true" />
|
||||
|
||||
<exchange name="magento-topic-based-exchange4" type="topic" connection="amqp">
|
||||
<binding id="wildcard1" destination="topic-queue1" destinationType="queue" topic="#">
|
||||
<arguments>
|
||||
<argument name="test" xsi:type="string">one</argument>
|
||||
</arguments>
|
||||
</binding>
|
||||
<binding id="wildcard2" destination="topic-queue2" destinationType="queue" topic="*.*.*" />
|
||||
</exchange>
|
||||
|
||||
<exchange name="overlappingDeprecatedExchange" type="topic">
|
||||
<binding id="binding1" topic="overlapping.topic.declaration" destinationType="queue" destination="topology.config.queue" />
|
||||
<binding id="binding2" topic="deprecated.config.async.string.topic" destinationType="queue" destination="topology.config.queue" />
|
||||
</exchange>
|
||||
</config>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Framework\Component\ComponentRegistrar;
|
||||
|
||||
$registrar = new ComponentRegistrar();
|
||||
if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleMessageQueueConfiguration') === null) {
|
||||
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleMessageQueueConfiguration', __DIR__);
|
||||
}
|
||||
Reference in New Issue
Block a user