Первичная реализация компонентов RabbitMQ в проекте

This commit is contained in:
ErickSkrauch
2016-04-12 00:46:44 +03:00
parent a021b61412
commit d2c064ac88
10 changed files with 445 additions and 1 deletions

View File

@ -0,0 +1,32 @@
<?php
namespace console\controllers;
use common\components\RabbitMQ\Component as RabbitMQComponent;
use console\controllers\base\AmqpController;
class AccountQueueController extends AmqpController {
public function getExchangeName() {
return 'account';
}
public function getQueueName() {
return 'account-operations';
}
public function getExchangeDeclareArgs() {
return array_replace(parent::getExchangeDeclareArgs(), [
1 => RabbitMQComponent::TYPE_DIRECT, // exchange-type -> direct
3 => false, // no-ack -> false
]);
}
public function getQueueBindArgs($exchangeName, $queueName) {
return [$exchangeName, $queueName, '#']; // Мы хотим получать сюда все события по аккаунту
}
public function routeChangeUsername($body) {
// TODO: implement this
}
}