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 +4 -4
- data/CHANGELOG.md +11 -1
- data/lib/receptor_controller/client/configuration.rb +1 -1
- data/lib/receptor_controller/client/response_worker.rb +3 -0
- data/lib/receptor_controller/client/version.rb +1 -1
- data/spec/receptor_controller/directive_blocking_spec.rb +3 -2
- data/spec/receptor_controller/directive_non_blocking_spec.rb +5 -5
- 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: 7e0fca40eecf936d8ef48f10f5ff0a9c0a8f285496d504a4942b85f5ad43b679
|
4
|
+
data.tar.gz: c48de26017a7f7b2193d13603abe1ebfafaf55974efd1e1cc5700e89b3097394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cabdb3d3176a0d6591a4b4fb06422481cf51f248edf669db455fc9f1ab9a98c19887d2b3b4780568be92058477d424164c158f49bc5ec9afbe1630becd273d6
|
7
|
+
data.tar.gz: fbe4d361bb3dfff586d6e6da8391623a5a92fcdc224a15c6c3ace6379105748562b6bc87f360d84556170b271298b3661985b88bddd3b8d8fe9ab60e0e8f4e6c
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
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
|
@@ -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,6 +1,6 @@
|
|
1
1
|
require "receptor_controller/client/directive_blocking"
|
2
2
|
|
3
|
-
RSpec.
|
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.
|
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
|
|