hyperf-chat/app/Amqp/Producer/DemoProducer.php

34 lines
641 B
PHP
Raw Normal View History

2020-11-02 22:45:37 +08:00
<?php
declare(strict_types=1);
namespace App\Amqp\Producer;
use Hyperf\Amqp\Builder\ExchangeBuilder;
use Hyperf\Amqp\Message\ProducerMessage;
use Hyperf\Amqp\Message\Type;
class DemoProducer extends ProducerMessage
{
public $exchange = 'im.message.fanout';
public $type = Type::FANOUT;
/**
* 重写创建交换机方法
* 注释 添加
*
* @return ExchangeBuilder
*/
// public function getExchangeBuilder(): ExchangeBuilder
// {
// return parent::getExchangeBuilder()->setAutoDelete(true);
// }
public function __construct($data)
{
$this->payload = $data;
}
}