-
Notifications
You must be signed in to change notification settings - Fork 1
/
OrderCenterConsumer.php
39 lines (30 loc) · 997 Bytes
/
OrderCenterConsumer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
use Example\Consumer\MessageData\OrderCloseData;
use Example\Consumer\MessageData\OrderSubmitData;
use Losingbattle\RocketMqHttp\Annotation\Consumer;
use Losingbattle\RocketMqHttp\Message\ConsumerMessage;
use Losingbattle\RocketMqHttp\Result;
#[Consumer(topic: "order_center_normal_topic", groupId: "GID_order_center_status_change", numOfMessages: 16, waitSeconds: 30)]
class OrderCenterConsumer extends ConsumerMessage
{
public function __construct()
{
$this->registerRoute('order_submit', [$this, 'orderSubmit']);
$this->registerRoute('order_close', [$this, 'orderClose']);
}
public function isEnable(): bool
{
return false;
}
public function orderSubmit(OrderSubmitData $orderSubmitData): string
{
return Result::ACK;
}
public function orderClose(OrderCloseData $orderCloseData): string
{
return Result::ACK;
}
public function orderStatus(array $data){
}
}