istox 0.1.110 → 0.1.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6cf8bd2229dff425f2a56898ef0a433fc0f3e51f28db6e8181ac5b3d53d8dd4
4
- data.tar.gz: 33a72d66d7c1d4911ecdb72b4eb90d09238001e678185b63068c5e7368168532
3
+ metadata.gz: 4f5acbf393cee60e583e1ec059086b0ae70560b8f239036d969afe75f0f8d192
4
+ data.tar.gz: c2fc45761d3e3ffbf6f64b145576189488c65a01fde58950993bb0fe8f86a45a
5
5
  SHA512:
6
- metadata.gz: 454dcd73c46eb09bb47f3c44452c9dcf67f6150252135efa89b0e86b028595bf6f0a6c39a54377fc6987ec66c03c3330f682d7a878bd96aa1736595793738699
7
- data.tar.gz: ad3a833f3564b9987c9d23252a9dc61a888487fa5327682772bf5aad300ebfe390c5c23413b22a2e2a60d14e5a12a62275738c693fc784cfa68cbc9c84c30c67
6
+ metadata.gz: 596a7a0c61bad590f3b3153e17e7ec5406b641b51d47dd61ab1aee0036f26ac442129811e67173c19cba3ec96629f2d3486052cc5d002ff288dd9fc76c7476b8
7
+ data.tar.gz: 7403276b2b981b00e39dd6652b6b0931d4662bd8b8ef0dd7fc30d4b4a0f86b31da1f490bd205594a23dc8d1de251c4c66b4041b49ace182de676f7aa5ba3d91b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.1.108)
4
+ istox (0.1.110)
5
5
  awesome_print
6
6
  binding_of_caller
7
7
  bunny (>= 2.12.0)
@@ -60,6 +60,9 @@ module Istox
60
60
  id: model.id,
61
61
  extra: model.handle_extra
62
62
  }
63
+ },
64
+ options: {
65
+ publish_confirm: false
63
66
  }
64
67
  )
65
68
 
@@ -73,6 +76,9 @@ module Istox
73
76
  purpose: receipt.activity,
74
77
  message: receipt.message
75
78
  }
79
+ },
80
+ options: {
81
+ publish_confirm: false
76
82
  }
77
83
  )
78
84
  rescue StandardError => e
@@ -8,6 +8,9 @@ module Istox
8
8
  # exchange can be nil if routing_key is unique in "publish" section, this function will be able to identify which exchange it is using
9
9
  # else both routing_key and exchange should be provided
10
10
  # check http://reference.rubybunny.info/Bunny/Exchange.html#publish-instance_method for available publish options
11
+ # extra publish options: {
12
+ # publish_confirm: true/false
13
+ # }
11
14
  def publish(exchange: nil, routing_key: nil, message:, options: {})
12
15
  raise 'Exchange and routing key cannot be nil at the same time.' if exchange.nil? && routing_key.nil?
13
16
 
@@ -56,8 +59,14 @@ module Istox
56
59
  raise "Exchange type #{exchange_config.type} is not valid/supported."
57
60
  end
58
61
 
59
- success = channel.wait_for_confirms
60
- raise 'RABBITMQ publish acknowlegement failed' unless success
62
+ publish_confirm = options[:publish_confirm].nil? ? true : options[:publish_confirm]
63
+
64
+ if publish_confirm
65
+ log.info 'Waiting for RABBITMQ publisher acknowledgement'
66
+
67
+ success = channel.wait_for_confirms
68
+ raise 'RABBITMQ publish acknowlegement failed' unless success
69
+ end
61
70
 
62
71
  log.info 'Publish RABBITMQ message success'
63
72
  end
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.110'.freeze
2
+ VERSION = '0.1.111'.freeze
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.110
4
+ version: 0.1.111
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng