mirror of
				https://github.com/elyby/accounts.git
				synced 2025-05-31 14:11:46 +05:30 
			
		
		
		
	Обновлена версия amqp controller, удалён gii, очередь событий аккаунтов переведена в устойчивый режим
This commit is contained in:
		@@ -3,10 +3,9 @@ namespace console\controllers;
 | 
			
		||||
 | 
			
		||||
use common\components\Mojang\Api as MojangApi;
 | 
			
		||||
use common\components\Mojang\exceptions\NoContentException;
 | 
			
		||||
use common\components\RabbitMQ\Component as RabbitMQComponent;
 | 
			
		||||
use common\models\amqp\UsernameChanged;
 | 
			
		||||
use common\models\MojangUsername;
 | 
			
		||||
use console\controllers\base\AmqpController;
 | 
			
		||||
use Ely\Amqp\Builder\Configurator;
 | 
			
		||||
use GuzzleHttp\Exception\RequestException;
 | 
			
		||||
 | 
			
		||||
class AccountQueueController extends AmqpController {
 | 
			
		||||
@@ -15,19 +14,10 @@ class AccountQueueController extends AmqpController {
 | 
			
		||||
        return 'events';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getQueueName() {
 | 
			
		||||
        return 'accounts-events';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    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 configure(Configurator $configurator) {
 | 
			
		||||
        $configurator->exchange->topic()->durable();
 | 
			
		||||
        $configurator->queue->name('accounts-accounts-events')->durable();
 | 
			
		||||
        $configurator->bind->routingKey('accounts.username-changed');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getRoutesMap() {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
<?php
 | 
			
		||||
namespace console\controllers\base;
 | 
			
		||||
namespace console\controllers;
 | 
			
		||||
 | 
			
		||||
use Ely\Amqp\ControllerTrait;
 | 
			
		||||
use Yii;
 | 
			
		||||
		Reference in New Issue
	
	Block a user