Обновлена версия amqp controller, удалён gii, очередь событий аккаунтов переведена в устойчивый режим

This commit is contained in:
ErickSkrauch 2016-11-15 22:45:30 +03:00
parent bfbcf141ee
commit 5c02b54010
4 changed files with 7 additions and 21 deletions

View File

@ -12,8 +12,5 @@ return [
'class' => yii\debug\Module::class, 'class' => yii\debug\Module::class,
'allowedIPs' => ['*'], 'allowedIPs' => ['*'],
], ],
'gii' => [
'class' => yii\gii\Module::class,
],
], ],
]; ];

View File

@ -24,13 +24,12 @@
"php-amqplib/php-amqplib": "^2.6.2", "php-amqplib/php-amqplib": "^2.6.2",
"ely/yii2-tempmail-validator": "~1.0.0", "ely/yii2-tempmail-validator": "~1.0.0",
"emarref/jwt": "~1.0.3", "emarref/jwt": "~1.0.3",
"ely/amqp-controller": "^0.1.2", "ely/amqp-controller": "dev-master#d7f8cdbc66c45e477c9c7d5d509bc0c1b11fd3ec",
"ely/email-renderer": "dev-master#38a148cd5081147acc31125ddc49966b149f65cf" "ely/email-renderer": "dev-master#38a148cd5081147acc31125ddc49966b149f65cf"
}, },
"require-dev": { "require-dev": {
"yiisoft/yii2-codeception": "*", "yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*", "yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*", "yiisoft/yii2-faker": "*",
"flow/jsonpath": "^0.3.1", "flow/jsonpath": "^0.3.1",
"codeception/codeception": "~2.2.4", "codeception/codeception": "~2.2.4",

View File

@ -3,10 +3,9 @@ namespace console\controllers;
use common\components\Mojang\Api as MojangApi; use common\components\Mojang\Api as MojangApi;
use common\components\Mojang\exceptions\NoContentException; use common\components\Mojang\exceptions\NoContentException;
use common\components\RabbitMQ\Component as RabbitMQComponent;
use common\models\amqp\UsernameChanged; use common\models\amqp\UsernameChanged;
use common\models\MojangUsername; use common\models\MojangUsername;
use console\controllers\base\AmqpController; use Ely\Amqp\Builder\Configurator;
use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Exception\RequestException;
class AccountQueueController extends AmqpController { class AccountQueueController extends AmqpController {
@ -15,19 +14,10 @@ class AccountQueueController extends AmqpController {
return 'events'; return 'events';
} }
public function getQueueName() { public function configure(Configurator $configurator) {
return 'accounts-events'; $configurator->exchange->topic()->durable();
} $configurator->queue->name('accounts-accounts-events')->durable();
$configurator->bind->routingKey('accounts.username-changed');
protected function getExchangeDeclareArgs() {
return array_replace(parent::getExchangeDeclareArgs(), [
1 => RabbitMQComponent::TYPE_TOPIC, // type -> topic
3 => true, // durable -> true
]);
}
protected function getQueueBindArgs($exchangeName, $queueName) {
return [$queueName, $exchangeName, 'accounts.#'];
} }
public function getRoutesMap() { public function getRoutesMap() {

View File

@ -1,5 +1,5 @@
<?php <?php
namespace console\controllers\base; namespace console\controllers;
use Ely\Amqp\ControllerTrait; use Ely\Amqp\ControllerTrait;
use Yii; use Yii;