avro_turf 1.11.0 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/avro_turf/confluent_schema_registry.rb +4 -2
- data/lib/avro_turf/messaging.rb +5 -2
- data/lib/avro_turf/version.rb +1 -1
- data/spec/confluent_schema_registry_spec.rb +12 -0
- data/spec/messaging_spec.rb +24 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94e8abd646816e6e375365c50ed19eebb3bfd4722548aba30fca974740fd7788
|
4
|
+
data.tar.gz: 18bba7e20c8ac10b52177af05db7b4ea6b461f696f4230c7086d1b5e3a7479df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b2b977f70cdc2c497a2cf1449d9f84bf11a6d7ce62022fd9295a58ea1133fe10674431dbf765d8676ba404e54c73f5bc35016868fd6e3ce2cbef4ea5027de07
|
7
|
+
data.tar.gz: a3ad6d0518e93b12a5371ac338bcb99e7f7acd22728d2527c16a57888e8fe39567d1c8bc57060451cf2b536c653e8cb470809e76381e2ec07a0c3b8cbaefe734
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## v1.12.0
|
6
|
+
|
7
|
+
- Add `connect_timeout` parameter to `AvroTurf::Messaging` to set the timeout for the connection to the schema registry (#197)
|
8
|
+
|
5
9
|
## v1.11.0
|
6
10
|
|
7
11
|
- Add `decode_all` and `decode_all_from_stream` methods to return all entries in a data file (#194)
|
@@ -15,7 +15,8 @@ class AvroTurf::ConfluentSchemaRegistry
|
|
15
15
|
client_key_pass: nil,
|
16
16
|
client_cert_data: nil,
|
17
17
|
client_key_data: nil,
|
18
|
-
path_prefix: nil
|
18
|
+
path_prefix: nil,
|
19
|
+
connect_timeout: nil
|
19
20
|
)
|
20
21
|
@path_prefix = path_prefix
|
21
22
|
@logger = logger
|
@@ -33,7 +34,8 @@ class AvroTurf::ConfluentSchemaRegistry
|
|
33
34
|
client_key: client_key,
|
34
35
|
client_key_pass: client_key_pass,
|
35
36
|
client_cert_data: client_cert_data,
|
36
|
-
client_key_data: client_key_data
|
37
|
+
client_key_data: client_key_data,
|
38
|
+
connect_timeout: connect_timeout
|
37
39
|
)
|
38
40
|
end
|
39
41
|
|
data/lib/avro_turf/messaging.rb
CHANGED
@@ -55,6 +55,7 @@ class AvroTurf
|
|
55
55
|
# client_key_pass - Password to go with client_key (optional).
|
56
56
|
# client_cert_data - In-memory client certificate (optional).
|
57
57
|
# client_key_data - In-memory client private key to go with client_cert_data (optional).
|
58
|
+
# connect_timeout - Timeout to use in the connection with the schema registry (optional).
|
58
59
|
def initialize(
|
59
60
|
registry: nil,
|
60
61
|
registry_url: nil,
|
@@ -71,7 +72,8 @@ class AvroTurf
|
|
71
72
|
client_key: nil,
|
72
73
|
client_key_pass: nil,
|
73
74
|
client_cert_data: nil,
|
74
|
-
client_key_data: nil
|
75
|
+
client_key_data: nil,
|
76
|
+
connect_timeout: nil
|
75
77
|
)
|
76
78
|
@logger = logger || Logger.new($stderr)
|
77
79
|
@namespace = namespace
|
@@ -89,7 +91,8 @@ class AvroTurf
|
|
89
91
|
client_key_pass: client_key_pass,
|
90
92
|
client_cert_data: client_cert_data,
|
91
93
|
client_key_data: client_key_data,
|
92
|
-
path_prefix: registry_path_prefix
|
94
|
+
path_prefix: registry_path_prefix,
|
95
|
+
connect_timeout: connect_timeout
|
93
96
|
)
|
94
97
|
)
|
95
98
|
@schemas_by_id = {}
|
data/lib/avro_turf/version.rb
CHANGED
@@ -8,6 +8,7 @@ describe AvroTurf::ConfluentSchemaRegistry do
|
|
8
8
|
let(:client_cert) { "test client cert" }
|
9
9
|
let(:client_key) { "test client key" }
|
10
10
|
let(:client_key_pass) { "test client key password" }
|
11
|
+
let(:connect_timeout) { 10 }
|
11
12
|
|
12
13
|
it_behaves_like "a confluent schema registry client" do
|
13
14
|
let(:registry) {
|
@@ -30,4 +31,15 @@ describe AvroTurf::ConfluentSchemaRegistry do
|
|
30
31
|
)
|
31
32
|
}
|
32
33
|
end
|
34
|
+
|
35
|
+
it_behaves_like "a confluent schema registry client" do
|
36
|
+
let(:registry) {
|
37
|
+
described_class.new(
|
38
|
+
registry_url,
|
39
|
+
user: user,
|
40
|
+
password: password,
|
41
|
+
connect_timeout: connect_timeout
|
42
|
+
)
|
43
|
+
}
|
44
|
+
end
|
33
45
|
end
|
data/spec/messaging_spec.rb
CHANGED
@@ -425,4 +425,27 @@ describe AvroTurf::Messaging do
|
|
425
425
|
it_behaves_like 'encoding and decoding with the schema from registry'
|
426
426
|
it_behaves_like 'encoding and decoding with the schema_id from registry'
|
427
427
|
end
|
428
|
-
|
428
|
+
|
429
|
+
context 'with a connect timeout' do
|
430
|
+
let(:avro) {
|
431
|
+
AvroTurf::Messaging.new(
|
432
|
+
registry_url: registry_url,
|
433
|
+
schemas_path: "spec/schemas",
|
434
|
+
logger: logger,
|
435
|
+
client_cert: client_cert,
|
436
|
+
client_key: client_key,
|
437
|
+
client_key_pass: client_key_pass,
|
438
|
+
connect_timeout: 10
|
439
|
+
)
|
440
|
+
}
|
441
|
+
|
442
|
+
it_behaves_like "encoding and decoding with the schema from schema store"
|
443
|
+
it_behaves_like 'encoding and decoding with the schema from registry'
|
444
|
+
it_behaves_like 'encoding and decoding with the schema_id from registry'
|
445
|
+
|
446
|
+
it 'passes the connect timeout setting to Excon' do
|
447
|
+
expect(Excon).to receive(:new).with(anything, hash_including(connect_timeout: 10)).and_call_original
|
448
|
+
avro
|
449
|
+
end
|
450
|
+
end
|
451
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avro_turf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Schierbeck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro
|