新增amqp队列,新增订单创建

This commit is contained in:
2023-02-28 18:06:37 +08:00
parent 67937326ac
commit 0158250f41
18 changed files with 441 additions and 105 deletions
@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace App\Amqp\Producer;
use Hyperf\Amqp\Annotation\Producer;
use Hyperf\Amqp\Message\ProducerDelayedMessageTrait;
use Hyperf\Amqp\Message\ProducerMessage;
use Hyperf\Amqp\Message\Type;
/**
* 延迟队列
* 生产者
*/
#[Producer]
class AmqpDelayDirectProducer extends ProducerMessage
{
use ProducerDelayedMessageTrait;
protected string $exchange = 'amqp.delay.direct';
protected string $type = Type::DIRECT;
protected string|array $routingKey = '';
public function __construct($data)
{
$this->payload = $data;
}
}