-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOrderCenterDelayConsumer.php
More file actions
37 lines (28 loc) · 937 Bytes
/
Copy pathOrderCenterDelayConsumer.php
File metadata and controls
37 lines (28 loc) · 937 Bytes
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
<?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_delay_topic", groupId: "GID_order_center_consumer", numOfMessages: 16, waitSeconds: 30)]
class OrderCenterDelayConsumer 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;
}
}