-
Notifications
You must be signed in to change notification settings - Fork 1
/
consumer_getter.go
53 lines (44 loc) · 1.04 KB
/
consumer_getter.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package rabbitmqclient
// GetQueueDeclare get queue declaration for this consumer.
func (c *Consumer) GetQueueDeclare() *QueueDeclare {
c.mutex.RLock()
defer c.mutex.RUnlock()
return c.declare
}
// GetQueueBind gets the queue binder for this consumer.
func (c *Consumer) GetQueueBind() *QueueBind {
c.mutex.RLock()
defer c.mutex.RUnlock()
return c.bind
}
func (c *Consumer) getContainer() *Container {
return c.container
}
func (c *Consumer) getQueue() string {
c.mutex.RLock()
defer c.mutex.RUnlock()
return c.declare.Name
}
func (c *Consumer) getTopic() string {
c.mutex.RLock()
defer c.mutex.RUnlock()
return c.bind.Key
}
func (c *Consumer) getChannelKey() string {
c.mutex.RLock()
defer c.mutex.RUnlock()
return c.channelKey
}
func (c *Consumer) getConsume() *Consume {
c.mutex.RLock()
defer c.mutex.RUnlock()
return c.consume
}
func (c *Consumer) getExchange() string {
c.mutex.RLock()
defer c.mutex.RUnlock()
return c.bind.Exchange
}
func (c *Consumer) getExchangeTopic() string {
return c.getExchange() + "." + c.getTopic()
}