-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconsumer_connection.go
36 lines (31 loc) · 1.16 KB
/
consumer_connection.go
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
package rocketmq
var ConsumeTypes = struct {
Actively string //主动方式消费
Passively string //被动方式消费
}{
"CONSUME_ACTIVELY",
"CONSUME_PASSIVELY",
}
type ConsumerConnection struct {
ConnectionSet []*Connection `json:"connectionSet"`
SubscriptionTable map[string]*SubscriptionData `json:"subscriptionTable"`
ConsumeType string `json:"consumeType"`
MessageModel string `json:"messageModel"`
ConsumeFromWhere string `json:"consumeFromWhere"`
//subscriptionTableLock sync.RWMutex `json:"-"`
}
type Connection struct {
ClientId string `json:"clientId"`
ClientAddr string `json:"clientAddr"`
Language string `json:"language"`
Version int `json:"version"`
}
type ConsumeStats struct {
OffsetTable map[MessageQueue]OffsetWrapper `json:"offsetTable"`
ConsumeTps int64 `json:"consumeTps"`
}
type OffsetWrapper struct {
BrokerOffset int64 `json:"brokerOffset"`
ConsumerOffset int64 `json:"consumerOffset"`
LastTimestamp int64 `json:"lastTimestamp"` // 消费的最后一条消息对应的时间戳
}