istox 0.1.32 → 0.1.33

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39d1064d8640fa9bf2c1d320c6960fdb4faeb844681752e4ee651d2e0ea57eb9
4
- data.tar.gz: 4027205d6d0131107ebeca16b4549c14329be1ddd09f13c7bb0977b22bd28d9a
3
+ metadata.gz: 7fc3359a8ef0d3f3087ac19a382173e286f7afb86bd8873e2900f49d72d19fa9
4
+ data.tar.gz: 1671921fcbc238976d7ca0a91d6f0e63b1e37a43549c14d36ed604ba9a7c9a7f
5
5
  SHA512:
6
- metadata.gz: d066884c78db2865629d720f132f89bf1c8fd89565beda9272464eeadf2c43b0fcf45ee6b53154786568152d3396fcd6043bfa11534dab677bb090fe7559390f
7
- data.tar.gz: 8c9e8fb4b81e5358f0804d27cbbec73c47bef5a76ce5d2fa260647a756dffa7bf506deedd08f06b8f559ee3a58acda93efb05123ea60f3f903f67033483ab3cb
6
+ metadata.gz: eeaf50955d5a51277e6d98f186784aceff0c857c2de7706e240c45efc121eb17c0d0907021a3efe5a8a1c972c0315224a142f4c13c81cfec9ac35106edb9bdeb
7
+ data.tar.gz: db41a861e42b027a331a9bdbc5d415548643823ff1bedd1ad9a9210b98ea938d20ff408a40e16595697a69b341d56c2768249d0a28d40cec6f961f12d6ef9d65
@@ -33,8 +33,13 @@ module Istox
33
33
  config.name,
34
34
  durable: config.durable
35
35
  ).bind(exchange(config.exchange, exchange_type), options)
36
+
37
+ manual_ack = true
38
+ if !config.manual_ack.nil?
39
+ manual_ack = config.manual_ack
40
+ end
36
41
 
37
- queue.subscribe do |delivery_info, metadata, payload|
42
+ queue.subscribe manual_ack: manual_ack, block: true do |delivery_info, metadata, payload|
38
43
  begin
39
44
  Rails.logger.info("Processing in consumer: #{klass}")
40
45
  klass.new.process(
@@ -42,10 +47,10 @@ module Istox
42
47
  metadata,
43
48
  delivery_info
44
49
  )
50
+ $channel.ack(delivery_info.delivery_tag) if manual_ack
45
51
  rescue Exception => e
46
52
  Rails.logger.error(e)
47
- ensure
48
- $channel.ack(delivery_info.delivery_tag) if config.manual_ack
53
+ channel.nack(delivery_info.delivery_tag, false, true)
49
54
  end
50
55
  end
51
56
  end
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = "0.1.32"
2
+ VERSION = "0.1.33"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.32
4
+ version: 0.1.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng