istox 0.1.110 → 0.1.111
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/istox/consumers/blockchain_status_handler.rb +6 -0
- data/lib/istox/helpers/publisher.rb +11 -2
- data/lib/istox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f5acbf393cee60e583e1ec059086b0ae70560b8f239036d969afe75f0f8d192
|
4
|
+
data.tar.gz: c2fc45761d3e3ffbf6f64b145576189488c65a01fde58950993bb0fe8f86a45a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 596a7a0c61bad590f3b3153e17e7ec5406b641b51d47dd61ab1aee0036f26ac442129811e67173c19cba3ec96629f2d3486052cc5d002ff288dd9fc76c7476b8
|
7
|
+
data.tar.gz: 7403276b2b981b00e39dd6652b6b0931d4662bd8b8ef0dd7fc30d4b4a0f86b31da1f490bd205594a23dc8d1de251c4c66b4041b49ace182de676f7aa5ba3d91b
|
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
60
|
-
|
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
|
data/lib/istox/version.rb
CHANGED