File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ require 'rabbitmq'
50
50
51
51
consumer = RabbitMQ ::Client .new .start.channel
52
52
consumer.basic_qos(prefetch_count: 500 )
53
- consumer.basic_consume(" some_queue" )
53
+ res = consumer.basic_consume(" some_queue" )
54
+ tag = res[:properties ][:consumer_tag ]
54
55
55
56
count = 0
56
57
consumer.on :basic_deliver do |message |
@@ -62,6 +63,7 @@ consumer.on :basic_deliver do |message|
62
63
end
63
64
64
65
consumer.run_loop!
66
+ consumer.basic_cancel(tag)
65
67
```
66
68
67
69
## Contributing
Original file line number Diff line number Diff line change 3
3
4
4
consumer = RabbitMQ ::Client . new . start . channel
5
5
consumer . basic_qos ( prefetch_count : 500 )
6
- consumer . basic_consume ( "some_queue" )
6
+ res = consumer . basic_consume ( "some_queue" )
7
+ tag = res [ :properties ] [ :consumer_tag ]
7
8
8
9
count = 0
9
10
consumer . on :basic_deliver do |message |
15
16
end
16
17
17
18
consumer . run_loop!
19
+ consumer . basic_cancel ( tag )
You can’t perform that action at this time.
0 commit comments