mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Первичная реализация компонентов RabbitMQ в проекте
This commit is contained in:
32
console/controllers/AccountQueueController.php
Normal file
32
console/controllers/AccountQueueController.php
Normal 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
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user