istox 0.1.130.pre.1 → 0.1.130.pre.2

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: d5d4e7c1ed144ded864cc61b37c4f14c9e480e4d99fed5e9e11d6d6f67b68b62
4
- data.tar.gz: 6a86ae7f05208885dff3091ec4dd298a852bb01159562acc2b77832672e91bc4
3
+ metadata.gz: 55b4aaaa8ab83cb0c061db6c94226363c0d8e6f781f94a2caa3c689454a1274d
4
+ data.tar.gz: 7e0daeaa9c8d49e66baa839ab2eebf08f7491978aeb4119541a768986ff77f37
5
5
  SHA512:
6
- metadata.gz: 7c02c224fa860aba3fe707b02c200a49c79b473e56785c82887e533a4519da8955767b7d7a71de24460667409887ff89e89a3ce3f190b743677b2a99b532f020
7
- data.tar.gz: 8ac8782cd41179f94b5eb9fdd579aecb12f8e56367b92305046996812065165a00fcabd5928765ebe5ce691b024fe9364b0e0831fa89cb728ca36dac2439b225
6
+ metadata.gz: 9a94d15db073a929c19b0780af1a83414a0423cc6ab5e88957807ce138434b6fc10a0c0dd349326f20ac6287f8dfc02033344dd380524483a32981d673a50166
7
+ data.tar.gz: 987b98782522ef8ca7231e128ffcdcb8100cc20a3a22248c1d12859ba3049df5ae97264a81f87becceee16eb2eacebd0a7d35827b604869abedadfa9b7fbc186
data/.idea/istox-gem.iml CHANGED
@@ -532,36 +532,36 @@
532
532
  </library>
533
533
  </orderEntry>
534
534
  <orderEntry type="module-library">
535
- <library name="faraday (vbundled(1.0.0)) [path][gem]" type="rubylib">
535
+ <library name="faraday (vbundled(0.17.3)) [path][gem]" type="rubylib">
536
536
  <properties>
537
537
  <option name="version" value="4" />
538
538
  </properties>
539
539
  <CLASSES>
540
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-1.0.0/lib" />
541
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-1.0.0/spec" />
542
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-1.0.0/examples" />
540
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-0.17.3/lib" />
541
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-0.17.3/spec" />
542
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-0.17.3/test" />
543
543
  </CLASSES>
544
544
  <SOURCES>
545
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-1.0.0/lib" />
546
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-1.0.0/spec" />
547
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-1.0.0/examples" />
545
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-0.17.3/lib" />
546
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-0.17.3/spec" />
547
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-0.17.3/test" />
548
548
  </SOURCES>
549
549
  <excluded>
550
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-1.0.0/spec" />
551
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-1.0.0/examples" />
550
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-0.17.3/spec" />
551
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday-0.17.3/test" />
552
552
  </excluded>
553
553
  </library>
554
554
  </orderEntry>
555
555
  <orderEntry type="module-library">
556
- <library name="faraday_middleware (vbundled(1.0.0.rc1)) [path][gem]" type="rubylib">
556
+ <library name="faraday_middleware (vbundled(0.14.0)) [path][gem]" type="rubylib">
557
557
  <properties>
558
558
  <option name="version" value="4" />
559
559
  </properties>
560
560
  <CLASSES>
561
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday_middleware-1.0.0.rc1/lib" />
561
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday_middleware-0.14.0/lib" />
562
562
  </CLASSES>
563
563
  <SOURCES>
564
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday_middleware-1.0.0.rc1/lib" />
564
+ <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/faraday_middleware-0.14.0/lib" />
565
565
  </SOURCES>
566
566
  </library>
567
567
  </orderEntry>
@@ -1391,24 +1391,6 @@
1391
1391
  </excluded>
1392
1392
  </library>
1393
1393
  </orderEntry>
1394
- <orderEntry type="module-library">
1395
- <library name="redlock (vbundled(1.2.0)) [path][gem]" type="rubylib">
1396
- <properties>
1397
- <option name="version" value="4" />
1398
- </properties>
1399
- <CLASSES>
1400
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/redlock-1.2.0/lib" />
1401
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/redlock-1.2.0/spec" />
1402
- </CLASSES>
1403
- <SOURCES>
1404
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/redlock-1.2.0/lib" />
1405
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/redlock-1.2.0/spec" />
1406
- </SOURCES>
1407
- <excluded>
1408
- <root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.5.0/gems/redlock-1.2.0/spec" />
1409
- </excluded>
1410
- </library>
1411
- </orderEntry>
1412
1394
  <orderEntry type="module-library">
1413
1395
  <library name="rspec (vbundled(3.8.0)) [path][gem]" type="rubylib">
1414
1396
  <properties>
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.1.129)
4
+ istox (0.1.130.pre.2)
5
5
  awesome_print
6
6
  binding_of_caller
7
7
  bunny (>= 2.12.0)
@@ -15,7 +15,6 @@ PATH
15
15
  redis (>= 2.0.0)
16
16
  redis-namespace (>= 1.0.0)
17
17
  redis-rails (~> 5.0.2)
18
- redlock (~> 1.2.0)
19
18
  vault (~> 0.1)
20
19
 
21
20
  GEM
@@ -91,14 +90,14 @@ GEM
91
90
  i18n (~> 0.5)
92
91
  fakeredis (0.7.0)
93
92
  redis (>= 3.2, < 5.0)
94
- faraday (1.0.0)
93
+ faraday (0.17.3)
95
94
  multipart-post (>= 1.2, < 3)
96
- faraday_middleware (1.0.0.rc1)
97
- faraday (~> 1.0)
95
+ faraday_middleware (0.14.0)
96
+ faraday (>= 0.7.4, < 1.0)
98
97
  ffi (1.12.2)
99
98
  globalid (0.4.2)
100
99
  activesupport (>= 4.2.0)
101
- google-protobuf (3.11.4)
100
+ google-protobuf (3.11.4-universal-darwin)
102
101
  googleapis-common-protos-types (1.0.4)
103
102
  google-protobuf (~> 3.0)
104
103
  graphlient (0.3.7)
@@ -109,7 +108,7 @@ GEM
109
108
  graphql-client (0.16.0)
110
109
  activesupport (>= 3.0)
111
110
  graphql (~> 1.8)
112
- grpc (1.27.0)
111
+ grpc (1.27.0-universal-darwin)
113
112
  google-protobuf (~> 3.11)
114
113
  googleapis-common-protos-types (~> 1.0)
115
114
  grpc-tools (1.27.0)
@@ -202,8 +201,6 @@ GEM
202
201
  redis-store (>= 1.2, < 2)
203
202
  redis-store (1.8.2)
204
203
  redis (>= 4, < 5)
205
- redlock (1.2.0)
206
- redis (>= 3.0.0, < 5.0)
207
204
  rspec (3.8.0)
208
205
  rspec-core (~> 3.8.0)
209
206
  rspec-expectations (~> 3.8.0)
data/istox.gemspec CHANGED
@@ -44,7 +44,6 @@ Gem::Specification.new do |spec|
44
44
  spec.add_dependency 'redis', '>= 2.0.0'
45
45
  spec.add_dependency 'redis-namespace', '>= 1.0.0'
46
46
  spec.add_dependency 'vault', '~> 0.1'
47
- spec.add_dependency 'redlock', '~>1.2.0'
48
47
  spec.add_development_dependency 'bullet', '~> 5.7.5'
49
48
  spec.add_development_dependency 'bundler', '~> 1.16'
50
49
  spec.add_development_dependency 'database_cleaner', '~> 1.6.0'
@@ -29,7 +29,6 @@ module Istox
29
29
 
30
30
  # Put channel in confirmation mode
31
31
  ch.confirm_select if opts[:confirm]
32
- log.debug "channel unconfirmed_set is #{ch.unconfirmed_set}"
33
32
 
34
33
  ch
35
34
  end
@@ -137,6 +136,12 @@ module Istox
137
136
  nil
138
137
  end
139
138
 
139
+ def queue_worker_param_format(consumer_key)
140
+ queue_config_from_consumer_key!(consumer_key)['worker_param_format'] || 'open_struct'
141
+ rescue
142
+ nil
143
+ end
144
+
140
145
  def queue_exclusive(consumer_key)
141
146
  queue_config_from_consumer_key!(consumer_key)['exclusive'] || false
142
147
  rescue
@@ -13,7 +13,7 @@ module Istox
13
13
  # publish_confirm: true/false
14
14
  # }
15
15
  def publish(exchange: nil, routing_key: nil, binding:nil, binding_suffix:nil, message:, options: {})
16
-
16
+ log.debug '************************* Publish ************************'
17
17
  if exchange.nil? && routing_key.nil?
18
18
  raise 'Exchange and routing key cannot be nil at the same time.' if binding.nil?
19
19
  exchange = ::Istox::BunnyBoot.binding_exchange_id(binding)
@@ -197,6 +197,7 @@ module Istox
197
197
  end
198
198
 
199
199
  def do_publish(ex, options = {}, message)
200
+ log.debug '************** do_publish ***************'
200
201
  eid = ::Istox::BunnyBoot.eid ex
201
202
  ch = ex.channel
202
203
  channel_id = ch.id
@@ -216,6 +217,7 @@ module Istox
216
217
  end
217
218
 
218
219
  if confirm && mode == 0
220
+ log.debug '************** Confirm && mode == 0 ***************'
219
221
  success = ex.channel.wait_for_confirms
220
222
  if success
221
223
  # ::Istox::BunnyBoot.del_tracker_on_channel channel_id
@@ -231,6 +233,7 @@ module Istox
231
233
  ret
232
234
  end
233
235
  end
236
+ log.debug '******************* End of do_publish ******************'
234
237
  rescue Bunny::ConnectionClosedError => e
235
238
  log.debug "Publish fails due to #{e}"
236
239
  sleep 1
@@ -142,14 +142,13 @@ module Istox
142
142
  retry_limit = ::Istox::BunnyBoot.queue_retry_limit consumer_key
143
143
  unless metadata[:priority] && retry_limit != -1 && metadata[:priority] >= retry_limit
144
144
  processing_paylod = JSON.parse(payload)
145
- payload_object = ::Istox::CommonHelper.to_open_struct(processing_paylod)
146
-
147
- log.info "Processing in consumer: #{klass}, paylod: #{payload_object.to_h.inspect}"
145
+ processing_paylod = ::Istox::CommonHelper.to_open_struct(processing_paylod) if ::Istox::BunnyBoot.queue_worker_param_format(consumer_key) == 'open_struct'
146
+ log.info "Processing in consumer: #{klass}, paylod: #{processing_paylod.to_h.inspect}"
148
147
 
149
148
  if @workers[ruby_class].nil?
150
- result = block.call(payload_object, metadata, delivery_info) unless block.nil?
149
+ result = block.call(processing_paylod, metadata, delivery_info) unless block.nil?
151
150
  else
152
- result = @workers[ruby_class].process(payload_object, metadata, delivery_info)
151
+ result = @workers[ruby_class].process(processing_paylod, metadata, delivery_info)
153
152
  end
154
153
  end
155
154
  # active_channel.ack(delivery_info.delivery_tag) if manual_ack
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.130.pre.1'.freeze
2
+ VERSION = '0.1.130.pre.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.130.pre.1
4
+ version: 0.1.130.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-17 00:00:00.000000000 Z
11
+ date: 2020-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -206,20 +206,6 @@ dependencies:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0.1'
209
- - !ruby/object:Gem::Dependency
210
- name: redlock
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - "~>"
214
- - !ruby/object:Gem::Version
215
- version: 1.2.0
216
- type: :runtime
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - "~>"
221
- - !ruby/object:Gem::Version
222
- version: 1.2.0
223
209
  - !ruby/object:Gem::Dependency
224
210
  name: bullet
225
211
  requirement: !ruby/object:Gem::Requirement