hyperf-message-push/hyperf-skeleton/app/Amqp/Producer/DemoProducer.php

23 lines
441 B
PHP

<?php
declare(strict_types=1);
namespace App\Amqp\Producer;
use Hyperf\Amqp\Annotation\Producer;
use Hyperf\Amqp\Message\ProducerMessage;
/**
* @Producer(exchange="hyperf", routingKey="hyperf")
*/
class DemoProducer extends ProducerMessage
{
public function __construct($data)
{
// 设置不同 pool
$this->poolName = 'default';
// 具体丢入队列中的信息
$this->payload = $data;
}
}