|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Freyo\LaravelQueueCMQ\Queue\Driver; |
|
4
|
|
|
|
|
5
|
|
|
class QueueMeta |
|
6
|
|
|
{ |
|
7
|
|
|
public $queueName; |
|
8
|
|
|
public $maxMsgHeapNum; |
|
9
|
|
|
public $pollingWaitSeconds; |
|
10
|
|
|
public $visibilityTimeout; |
|
11
|
|
|
public $maxMsgSize; |
|
12
|
|
|
public $msgRetentionSeconds; |
|
13
|
|
|
public $createTime; |
|
14
|
|
|
public $lastModifyTime; |
|
15
|
|
|
public $activeMsgNum; |
|
16
|
|
|
public $inactiveMsgNum; |
|
17
|
|
|
public $rewindSeconds; |
|
18
|
|
|
public $rewindmsgNum; |
|
19
|
|
|
public $minMsgTime; |
|
20
|
|
|
public $delayMsgNum; |
|
21
|
|
|
|
|
22
|
|
|
/* 队列属性 |
|
23
|
|
|
@note: 设置属性 |
|
24
|
|
|
:: maxMsgHeapNum: 最大堆积消息数 |
|
25
|
|
|
:: pollingWaitSeconds: receive message时,长轮询时间,单位:秒 |
|
26
|
|
|
:: visibilityTimeout: 消息可见性超时, 单位:秒 |
|
27
|
|
|
:: maxMsgSize: 消息最大长度, 单位:Byte |
|
28
|
|
|
:: msgRetentionSeconds: 消息保留周期,单位:秒 |
|
29
|
|
|
:: rewindSeconds : 最大回溯时间, 单位:秒 |
|
30
|
|
|
|
|
31
|
|
|
@note: 非设置属性 |
|
32
|
|
|
:: activeMsgNum: 可消费消息数,近似值 |
|
33
|
|
|
:: inactiveMsgNum: 正在被消费的消息数,近似值 |
|
34
|
|
|
:: createTime: queue创建时间,单位:秒 |
|
35
|
|
|
:: lastModifyTime: 修改queue属性的最近时间,单位:秒 |
|
36
|
|
|
:: queue_name: 队列名称 |
|
37
|
|
|
:: rewindmsgNum:已删除,但是任然在回溯保留时间内的消息数量 |
|
38
|
|
|
:: minMsgTime: 消息最小未消费时间,单位为秒 |
|
39
|
|
|
:: delayMsgNum:延时消息数量 |
|
40
|
|
|
*/ |
|
41
|
|
|
public function __construct() |
|
42
|
|
|
{ |
|
43
|
|
|
$this->queueName = ''; |
|
44
|
|
|
$this->maxMsgHeapNum = -1; |
|
45
|
|
|
$this->pollingWaitSeconds = 0; |
|
46
|
|
|
$this->visibilityTimeout = 30; |
|
47
|
|
|
$this->maxMsgSize = 65536; |
|
48
|
|
|
$this->msgRetentionSeconds = 345600; |
|
49
|
|
|
$this->createTime = -1; |
|
50
|
|
|
$this->lastModifyTime = -1; |
|
51
|
|
|
$this->activeMsgNum = -1; |
|
52
|
|
|
$this->inactiveMsgNum = -1; |
|
53
|
|
|
$this->rewindSeconds = 0; |
|
54
|
|
|
$this->rewindmsgNum = 0; |
|
55
|
|
|
$this->minMsgTime = 0; |
|
56
|
|
|
$this->delayMsgNum = 0; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function __toString() |
|
60
|
|
|
{ |
|
61
|
|
|
$info = ['visibilityTimeout' => $this->visibilityTimeout, |
|
62
|
|
|
'maxMsgHeapNum' => $this->maxMsgHeapNum, |
|
63
|
|
|
'maxMsgSize' => $this->maxMsgSize, |
|
64
|
|
|
'msgRetentionSeconds' => $this->msgRetentionSeconds, |
|
65
|
|
|
'pollingWaitSeconds' => $this->pollingWaitSeconds, |
|
66
|
|
|
'activeMsgNum' => $this->activeMsgNum, |
|
67
|
|
|
'inactiveMsgNum' => $this->inactiveMsgNum, |
|
68
|
|
|
'createTime' => date('Y-m-d H:i:s', $this->createTime), |
|
69
|
|
|
'lastModifyTime' => date('Y-m-d H:i:s', $this->lastModifyTime), |
|
70
|
|
|
'QueueName' => $this->queueName, |
|
71
|
|
|
'rewindSeconds' => $this->rewindSeconds, |
|
72
|
|
|
'rewindmsgNum' => $this->rewindmsgNum, |
|
73
|
|
|
'minMsgTime' => $this->minMsgTime, |
|
74
|
|
|
'delayMsgNum' => $this->delayMsgNum, ]; |
|
75
|
|
|
|
|
76
|
|
|
return json_encode($info); |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|