receptor_controller-client 0.0.3 → 0.0.4

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: aeb9b0b9d6b9ababec5a45682b5674596687374fd6ff6285b3ba0d053f01d0ca
4
- data.tar.gz: ec19064ed6c2fa29a3eac4c3e7aad616767946e1538b234fd15d8aec923f5012
3
+ metadata.gz: 7e0fca40eecf936d8ef48f10f5ff0a9c0a8f285496d504a4942b85f5ad43b679
4
+ data.tar.gz: c48de26017a7f7b2193d13603abe1ebfafaf55974efd1e1cc5700e89b3097394
5
5
  SHA512:
6
- metadata.gz: 472a2f6e751379bc75b17cc318ae0bf6880705099fa238891af27bc98e27abd65a675d5ad3058c6ef55f6241b6b424cd27f220d0834dd63b53e09a43aba7070f
7
- data.tar.gz: 657b3fb273f5ce72b50460e8483a20cdbdce1d5b22b1f552e52655f6551a10e7e7c9f3038f84e59af12e0a7e2e490f529e69c504d2bb5e23a528f4c014b4b132
6
+ metadata.gz: 9cabdb3d3176a0d6591a4b4fb06422481cf51f248edf669db455fc9f1ab9a98c19887d2b3b4780568be92058477d424164c158f49bc5ec9afbe1630becd273d6
7
+ data.tar.gz: fbe4d361bb3dfff586d6e6da8391623a5a92fcdc224a15c6c3ace6379105748562b6bc87f360d84556170b271298b3661985b88bddd3b8d8fe9ab60e0e8f4e6c
@@ -6,11 +6,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.0.4] - 2020-08-04
10
+ ### Added
11
+ - Default Kafka ACK to true
12
+
13
+ ## [0.0.3] - 2020-08-03
14
+ ### Added
15
+ - Do not send EOF message until all messages have been received
16
+
9
17
  ## [0.0.2] - 2020-07-31
10
18
  ### Initial release to rubygems.org
11
19
 
12
20
  ### Added
13
21
  - Added extra logging for messages
14
22
 
15
- [Unreleased]: https://github.com/RedHatInsights/receptor_controller-client-ruby/compare/v0.0.2...HEAD
23
+ [Unreleased]: https://github.com/RedHatInsights/receptor_controller-client-ruby/compare/v0.0.4...HEAD
24
+ [0.0.4]: https://github.com/RedHatInsights/receptor_controller-client-ruby/releases/tag/v0.0.4
25
+ [0.0.3]: https://github.com/RedHatInsights/receptor_controller-client-ruby/releases/tag/v0.0.3
16
26
  [0.0.2]: https://github.com/RedHatInsights/receptor_controller-client-ruby/releases/tag/v0.0.2
@@ -39,7 +39,7 @@ module ReceptorController
39
39
  @job_path = '/job'
40
40
  @pre_shared_key = nil
41
41
 
42
- @queue_auto_ack = false
42
+ @queue_auto_ack = true
43
43
  @queue_host = nil
44
44
  @queue_max_bytes = nil
45
45
  @queue_persist_ref = nil
@@ -119,6 +119,9 @@ module ReceptorController
119
119
  payload = unpack_payload(payload) if payload.kind_of?(String)
120
120
  callbacks[:msg_size] ? callbacks[:msg_size] += payload.size : callbacks[:msg_size] = payload.size
121
121
  callbacks[:receiver].send(callbacks[:response_callback], message_id, message_type, payload)
122
+ else
123
+ # Send the callback to release the thread.
124
+ callbacks[:receiver].send(callbacks[:response_callback], message_id, message_type, payload)
122
125
  end
123
126
 
124
127
  # We received all the messages, complete the message.
@@ -1,5 +1,5 @@
1
1
  module ReceptorController
2
2
  class Client
3
- VERSION = "0.0.3".freeze
3
+ VERSION = "0.0.4".freeze
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  require "receptor_controller/client/directive_blocking"
2
2
 
3
- RSpec.xdescribe ReceptorController::Client::DirectiveBlocking do
3
+ RSpec.describe ReceptorController::Client::DirectiveBlocking do
4
4
  # TODO: definitions below contain the same like non-blocking spec
5
5
  let(:external_tenant) { '0000001' }
6
6
  let(:organization_id) { '000001' }
@@ -106,7 +106,8 @@ RSpec.xdescribe ReceptorController::Client::DirectiveBlocking do
106
106
  response_message = {'code' => 0,
107
107
  'in_response_to' => http_response['id'],
108
108
  'message_type' => subject.class::MESSAGE_TYPE_EOF,
109
- 'payload' => 'Unimportant'}
109
+ 'payload' => 'Unimportant',
110
+ 'serial' => 1}
110
111
 
111
112
  allow(kafka_response).to receive(:payload).and_return(response_message.to_json)
112
113
 
@@ -1,6 +1,6 @@
1
1
  require "receptor_controller/client/directive_non_blocking"
2
2
 
3
- RSpec.xdescribe ReceptorController::Client::DirectiveNonBlocking do
3
+ RSpec.describe ReceptorController::Client::DirectiveNonBlocking do
4
4
  let(:external_tenant) { '0000001' }
5
5
  let(:organization_id) { '000001' }
6
6
  let(:identity) do
@@ -101,13 +101,13 @@ RSpec.xdescribe ReceptorController::Client::DirectiveNonBlocking do
101
101
  # Kafka response - 'response' type
102
102
  expect(subject).to receive(:response_success).twice.and_call_original
103
103
  message_type, payload = 'response', 'Testing payload'
104
- response_payload = {'code' => 0, 'in_response_to' => response_id, 'message_type' => message_type, 'payload' => payload}
104
+ response_payload = {'code' => 0, 'in_response_to' => response_id, 'message_type' => message_type, 'payload' => payload, :serial => 1}
105
105
  allow(response).to receive(:payload).and_return(response_payload.to_json)
106
106
  subject.response_worker.send(:process_message, response)
107
107
 
108
108
  # Kafka response - 'eof' type
109
109
  message_type = 'eof'
110
- response_payload = {'code' => 0, 'in_response_to' => response_id, 'message_type' => message_type, 'payload' => nil}
110
+ response_payload = {'code' => 0, 'in_response_to' => response_id, 'message_type' => message_type, 'payload' => nil, :serial => 2}
111
111
  allow(response).to receive(:payload).and_return(response_payload.to_json)
112
112
  subject.response_worker.send(:process_message, response)
113
113
 
@@ -142,7 +142,7 @@ RSpec.xdescribe ReceptorController::Client::DirectiveNonBlocking do
142
142
 
143
143
  # Kafka response - 'response' type - success
144
144
  message_type, payload = 'response', 'Testing payload'
145
- response_payload = {'code' => 0, 'in_response_to' => response_id, 'message_type' => message_type, 'payload' => payload}
145
+ response_payload = {'code' => 0, 'in_response_to' => response_id, 'message_type' => message_type, 'payload' => payload, :serial => 1}
146
146
  allow(response).to receive(:payload).and_return(response_payload.to_json)
147
147
  success_calls.times do
148
148
  subject.response_worker.send(:process_message, response)
@@ -150,7 +150,7 @@ RSpec.xdescribe ReceptorController::Client::DirectiveNonBlocking do
150
150
 
151
151
  # Kafka response - 'eof' type
152
152
  message_type = 'eof'
153
- response_payload = {'code' => 0, 'in_response_to' => response_id, 'message_type' => message_type, 'payload' => nil}
153
+ response_payload = {'code' => 0, 'in_response_to' => response_id, 'message_type' => message_type, 'payload' => nil, :serial => 4}
154
154
  allow(response).to receive(:payload).and_return(response_payload.to_json)
155
155
  subject.response_worker.send(:process_message, response)
156
156
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: receptor_controller-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Slemr