evt-consumer-postgres 2.2.0.0 → 2.3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/consumer/postgres.rb +1 -0
- data/lib/consumer/postgres/controls/id.rb +1 -1
- data/lib/consumer/postgres/controls/message.rb +2 -0
- data/lib/consumer/postgres/controls/stream_name.rb +2 -2
- data/lib/consumer/postgres/identifier.rb +7 -0
- data/lib/consumer/postgres/position_store.rb +4 -0
- data/lib/consumer/postgres/position_store/stream_name.rb +2 -6
- data/lib/consumer/postgres/postgres.rb +30 -12
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f2cedd4bf0b74f3dbaf6a106848d4565a5293e9e64c0d7aaaa65f858ed161fb
|
4
|
+
data.tar.gz: 3bbd51b10ef1e29d9389509635e848a93cf61125a19d5e3017ba4873ea065321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a35c5c9b664660be24a76276b90c8589ceaa9f2677c91ecdfca7ec2ec9442a12cdea5aa1f70bf863592d5403f1344d8c3e3c3eccac949c5c53cea05f7df15e39
|
7
|
+
data.tar.gz: f0576665c9132715ad5d6291a1d0b07c0b3a037a2e383e34a9b342394dc5a94e839063c663f47b0721da309e834abeea8f930172187df3567d962661d473ac3b
|
data/lib/consumer/postgres.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Consumer
|
2
2
|
module Postgres
|
3
3
|
module Controls
|
4
|
-
StreamName = ::
|
4
|
+
StreamName = Messaging::Controls::StreamName
|
5
5
|
|
6
6
|
module StreamName
|
7
7
|
module Position
|
@@ -11,7 +11,7 @@ module Consumer
|
|
11
11
|
|
12
12
|
types << 'position'
|
13
13
|
|
14
|
-
StreamName.example(
|
14
|
+
Messaging::Controls::StreamName.example(
|
15
15
|
id: id,
|
16
16
|
category: category,
|
17
17
|
types: types
|
@@ -9,7 +9,6 @@ module Consumer
|
|
9
9
|
raise Error, "Position store's stream name must be a category (Stream Name: #{stream_name})"
|
10
10
|
end
|
11
11
|
|
12
|
-
stream_id = MessageStore::StreamName.get_id(stream_name)
|
13
12
|
entity_name = MessageStore::StreamName.get_entity_name(stream_name)
|
14
13
|
type_list = MessageStore::StreamName.get_types(stream_name)
|
15
14
|
|
@@ -19,12 +18,9 @@ module Consumer
|
|
19
18
|
type_list << position_type
|
20
19
|
end
|
21
20
|
|
21
|
+
stream_id = nil
|
22
22
|
if not consumer_identifier.nil?
|
23
|
-
|
24
|
-
stream_id = consumer_identifier
|
25
|
-
else
|
26
|
-
stream_id = "#{stream_id}-#{consumer_identifier}"
|
27
|
-
end
|
23
|
+
stream_id = consumer_identifier
|
28
24
|
end
|
29
25
|
|
30
26
|
MessageStore::StreamName.stream_name(
|
@@ -12,32 +12,50 @@ module Consumer
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
|
17
|
-
logger.info(tag: :*) { "Batch Size: #{batch_size}" }
|
18
|
-
end
|
19
|
-
|
20
|
-
unless correlation.nil?
|
21
|
-
logger.info(tag: :*) { "Correlation: #{correlation}" }
|
22
|
-
end
|
15
|
+
def print_startup_info
|
16
|
+
STDOUT.puts " Correlation: #{correlation || '(none)'}"
|
23
17
|
|
24
18
|
unless group_member.nil? && group_size.nil?
|
25
|
-
|
19
|
+
STDOUT.puts " Group Member: #{group_member.inspect}"
|
20
|
+
STDOUT.puts " Group Size: #{group_size.inspect}"
|
26
21
|
end
|
27
22
|
|
28
23
|
unless condition.nil?
|
29
|
-
|
24
|
+
STDOUT.puts " Condition: #{condition.inspect || '(none)'}"
|
30
25
|
end
|
31
26
|
end
|
32
27
|
|
33
|
-
def
|
28
|
+
def log_startup_info
|
29
|
+
logger.info(tags: [:consumer, :start]) { "Correlation: #{correlation.inspect} (Consumer: #{self.class.name})" }
|
30
|
+
logger.info(tags: [:consumer, :start]) { "Batch Size: #{get.batch_size.inspect} (Consumer: #{self.class.name})" }
|
31
|
+
logger.info(tags: [:consumer, :start]) { "Group Member: #{group_member.inspect} (Consumer: #{self.class.name})" }
|
32
|
+
logger.info(tags: [:consumer, :start]) { "Group Size: #{group_size.inspect} (Consumer: #{self.class.name})" }
|
33
|
+
logger.info(tags: [:consumer, :start]) { "Condition: #{condition.inspect} (Consumer: #{self.class.name})" }
|
34
|
+
end
|
35
|
+
|
36
|
+
def starting
|
37
|
+
if identifier.nil? && !group_member.nil? && !group_size.nil?
|
38
|
+
raise Identifier::Error, 'Identifier must not be omitted when the consumer is a member of a group'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# TODO: Remove deprecated settings argument that has been replaced with session_settings when no longer in use (Nathan Ladd, Mon Nov 30 2020)
|
43
|
+
def configure(session_settings: nil, batch_size: nil, correlation: nil, group_member: nil, group_size: nil, condition: nil, settings: nil)
|
34
44
|
self.batch_size = batch_size
|
35
45
|
self.correlation = correlation
|
36
46
|
self.group_member = group_member
|
37
47
|
self.group_size = group_size
|
38
48
|
self.condition = condition
|
39
49
|
|
40
|
-
|
50
|
+
session_settings ||= settings
|
51
|
+
|
52
|
+
if not session_settings.nil?
|
53
|
+
if not session_settings.is_a?(::Settings)
|
54
|
+
session_settings = ::Settings.build(session_settings)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
MessageStore::Postgres::Session.configure(self, settings: session_settings)
|
41
59
|
session = self.session
|
42
60
|
|
43
61
|
get_session = MessageStore::Postgres::Session.build(settings: settings)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-consumer-postgres
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-consumer
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/consumer/postgres/controls/position/store/recorded.rb
|
71
71
|
- lib/consumer/postgres/controls/position/stream/write.rb
|
72
72
|
- lib/consumer/postgres/controls/stream_name.rb
|
73
|
+
- lib/consumer/postgres/identifier.rb
|
73
74
|
- lib/consumer/postgres/position_store.rb
|
74
75
|
- lib/consumer/postgres/position_store/recorded.rb
|
75
76
|
- lib/consumer/postgres/position_store/stream_name.rb
|
@@ -78,7 +79,7 @@ homepage: https://github.com/eventide-project/consumer-postgres
|
|
78
79
|
licenses:
|
79
80
|
- MIT
|
80
81
|
metadata: {}
|
81
|
-
post_install_message:
|
82
|
+
post_install_message:
|
82
83
|
rdoc_options: []
|
83
84
|
require_paths:
|
84
85
|
- lib
|
@@ -93,8 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
94
|
- !ruby/object:Gem::Version
|
94
95
|
version: '0'
|
95
96
|
requirements: []
|
96
|
-
rubygems_version: 3.
|
97
|
-
signing_key:
|
97
|
+
rubygems_version: 3.1.2
|
98
|
+
signing_key:
|
98
99
|
specification_version: 4
|
99
100
|
summary: Postgres implementation of continuous subscription to a category and message
|
100
101
|
dispatching to handlers
|