evt-message_store-postgres 0.11.1.1 → 0.11.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/message_store/postgres/get.rb +6 -6
- data/lib/message_store/postgres/put.rb +4 -4
- 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: 3aaea36c33f4470a5b7f03e55d052215a703803be6f61344e93d8c7bcf22f1a8
|
4
|
+
data.tar.gz: 609afa4033a21f1a6017108c13c4bc2f0c1845b4095997b75b4b76824d0e6250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd84d58b4bf17c457d2d2d0253f00e20c6d74a16413ffca640850baaed147446f48877d15746aa3e3d63a30890daaedde651d4fad9a70064b159743f6d5d9111
|
7
|
+
data.tar.gz: fe8ed8efdea68ae3121c849ec93fc2ee46f4c9f60aeaa3caf484add80f8e6bbf3d572b653fc186555f210fff0deadf31976fa8030c61390ee0a02da8dbb7c358
|
@@ -33,7 +33,7 @@ module MessageStore
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def call(stream_name, position: nil)
|
36
|
-
logger.trace { "Getting message data (Position: #{position.inspect}, Stream Name: #{stream_name}, Batch Size: #{batch_size.inspect})" }
|
36
|
+
logger.trace(tag: :get) { "Getting message data (Position: #{position.inspect}, Stream Name: #{stream_name}, Batch Size: #{batch_size.inspect})" }
|
37
37
|
|
38
38
|
position ||= Defaults.position
|
39
39
|
|
@@ -41,14 +41,14 @@ module MessageStore
|
|
41
41
|
|
42
42
|
message_data = convert(result)
|
43
43
|
|
44
|
-
logger.info { "Finished getting message data (Count: #{message_data.length}, Position: #{position.inspect}, Stream Name: #{stream_name}, Batch Size: #{batch_size.inspect})" }
|
44
|
+
logger.info(tag: :get) { "Finished getting message data (Count: #{message_data.length}, Position: #{position.inspect}, Stream Name: #{stream_name}, Batch Size: #{batch_size.inspect})" }
|
45
45
|
logger.info(tags: [:data, :message_data]) { message_data.pretty_inspect }
|
46
46
|
|
47
47
|
message_data
|
48
48
|
end
|
49
49
|
|
50
50
|
def get_result(stream_name, position)
|
51
|
-
logger.trace { "Getting result (Stream: #{stream_name}, Position: #{position.inspect}, Batch Size: #{batch_size.inspect}, Condition: #{condition || '(none)'})" }
|
51
|
+
logger.trace(tag: :get) { "Getting result (Stream: #{stream_name}, Position: #{position.inspect}, Batch Size: #{batch_size.inspect}, Condition: #{condition || '(none)'})" }
|
52
52
|
|
53
53
|
sql_command = self.class.sql_command(stream_name, position, batch_size, condition)
|
54
54
|
|
@@ -63,7 +63,7 @@ module MessageStore
|
|
63
63
|
|
64
64
|
result = session.execute(sql_command, params)
|
65
65
|
|
66
|
-
logger.debug { "Finished getting result (Count: #{result.ntuples}, Stream: #{stream_name}, Position: #{position.inspect}, Batch Size: #{batch_size.inspect}, Condition: #{condition || '(none)'})" }
|
66
|
+
logger.debug(tag: :get) { "Finished getting result (Count: #{result.ntuples}, Stream: #{stream_name}, Position: #{position.inspect}, Batch Size: #{batch_size.inspect}, Condition: #{condition || '(none)'})" }
|
67
67
|
|
68
68
|
result
|
69
69
|
end
|
@@ -89,7 +89,7 @@ module MessageStore
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def convert(result)
|
92
|
-
logger.trace { "Converting result to message data (Result Count: #{result.ntuples})" }
|
92
|
+
logger.trace(tag: :get) { "Converting result to message data (Result Count: #{result.ntuples})" }
|
93
93
|
|
94
94
|
message_data = result.map do |record|
|
95
95
|
record['data'] = Deserialize.data(record['data'])
|
@@ -99,7 +99,7 @@ module MessageStore
|
|
99
99
|
MessageData::Read.build record
|
100
100
|
end
|
101
101
|
|
102
|
-
logger.debug { "Converted result to message data (Message Data Count: #{message_data.length})" }
|
102
|
+
logger.debug(tag: :get) { "Converted result to message data (Message Data Count: #{message_data.length})" }
|
103
103
|
|
104
104
|
message_data
|
105
105
|
end
|
@@ -30,7 +30,7 @@ module MessageStore
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def call(write_message, stream_name, expected_version: nil)
|
33
|
-
logger.trace { "Putting message data (Type: #{write_message.type}, Stream Name: #{stream_name}, Expected Version: #{expected_version.inspect})" }
|
33
|
+
logger.trace(tag: :put) { "Putting message data (Type: #{write_message.type}, Stream Name: #{stream_name}, Expected Version: #{expected_version.inspect})" }
|
34
34
|
logger.trace(tags: [:data, :message_data]) { write_message.pretty_inspect }
|
35
35
|
|
36
36
|
write_message.id ||= identifier.get
|
@@ -39,7 +39,7 @@ module MessageStore
|
|
39
39
|
expected_version = ExpectedVersion.canonize(expected_version)
|
40
40
|
|
41
41
|
insert_message(id, stream_name, type, data, metadata, expected_version).tap do |position|
|
42
|
-
logger.info { "Put message data (Type: #{write_message.type}, Stream Name: #{stream_name}, Expected Version: #{expected_version.inspect}, ID: #{id.inspect}, Position: #{position})" }
|
42
|
+
logger.info(tag: :put) { "Put message data (Type: #{write_message.type}, Stream Name: #{stream_name}, Expected Version: #{expected_version.inspect}, ID: #{id.inspect}, Position: #{position})" }
|
43
43
|
logger.info(tags: [:data, :message_data]) { write_message.pretty_inspect }
|
44
44
|
end
|
45
45
|
end
|
@@ -66,7 +66,7 @@ module MessageStore
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def execute_query(id, stream_name, type, transformed_data, transformed_metadata, expected_version)
|
69
|
-
logger.trace { "Executing insert (Stream Name: #{stream_name}, Type: #{type}, Expected Version: #{expected_version.inspect}, ID: #{id.inspect})" }
|
69
|
+
logger.trace(tag: :put) { "Executing insert (Stream Name: #{stream_name}, Type: #{type}, Expected Version: #{expected_version.inspect}, ID: #{id.inspect})" }
|
70
70
|
|
71
71
|
params = [
|
72
72
|
id,
|
@@ -83,7 +83,7 @@ module MessageStore
|
|
83
83
|
raise_error e
|
84
84
|
end
|
85
85
|
|
86
|
-
logger.debug { "Executed insert (Type: #{type}, Stream Name: #{stream_name}, Expected Version: #{expected_version.inspect}, ID: #{id.inspect})" }
|
86
|
+
logger.debug(tag: :put) { "Executed insert (Type: #{type}, Stream Name: #{stream_name}, Expected Version: #{expected_version.inspect}, ID: #{id.inspect})" }
|
87
87
|
|
88
88
|
records
|
89
89
|
end
|