evt-messaging 2.5.3.0 → 2.5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29e2d25659fffe70ab1e14512f6c4a4adf7c9daa929f7303e3b96ae169fa4822
4
- data.tar.gz: 181e600b4ecebc75a08607b364c50e88600788e6fc2e7e62672df10b5c337998
3
+ metadata.gz: ba3a02132d665b05fe90598a8ff7a1678b2ca868fb4f47ade0fe80da9dadb793
4
+ data.tar.gz: fc424d43824775b2d672dcf1592bf3efe997f86453af341d05ceee3e56b3256e
5
5
  SHA512:
6
- metadata.gz: 41165cbff3b2bb5a74a39809812851737b228ad1a59d85ecf2a8f46268042e06aed3c0fc3223f30e084febec586b1df09234e625286e7a8dfff617a15878b630
7
- data.tar.gz: 88c7b54092d4b088de4c95f21f576c7c3e04a3e4cc805b0c32cdf4ae0479865c82e9d2195968ae7046d86508ba2aba1229ff9d7854179786447b2b798ecd7235
6
+ metadata.gz: 12f6e4b7ecd4b166ea798052c648297e3b46b2a73b8c2dd5da940f37bbb4fca1f30eae8af0731bb1539841cd390a03ea04dc360aec46cfc6465a4f55ac0877b5
7
+ data.tar.gz: 638d0cce0872792272e9c444dc2c92534c57ab9db50523c3a4cdd104b00ef36dba8e39786f7448d09569c8a0bdb4b4a906abeab025e9a4691d2cc6429eecac65
@@ -49,6 +49,12 @@ module Messaging
49
49
  "#{causation_message_stream_name}/#{causation_message_position}"
50
50
  end
51
51
 
52
+ def self.properties
53
+ {
54
+ some_property: 'some property value'
55
+ }
56
+ end
57
+
52
58
  def self.time
53
59
  Time::Raw.example
54
60
  end
@@ -57,6 +63,7 @@ module Messaging
57
63
  {
58
64
  stream_name: stream_name,
59
65
  position: position,
66
+ global_position: global_position,
60
67
 
61
68
  causation_message_stream_name: causation_message_stream_name,
62
69
  causation_message_position: causation_message_position,
@@ -66,7 +73,8 @@ module Messaging
66
73
 
67
74
  reply_stream_name: reply_stream_name,
68
75
 
69
- global_position: global_position,
76
+ properties: properties,
77
+
70
78
  time: time,
71
79
 
72
80
  schema_version: schema_version
@@ -33,6 +33,8 @@ module Messaging
33
33
 
34
34
  attribute :reply_stream_name, String
35
35
 
36
+ attribute :properties, Hash, default: -> { Hash.new }
37
+
36
38
  attribute :time, Time
37
39
 
38
40
  attribute :schema_version, String
@@ -126,6 +128,14 @@ module Messaging
126
128
  end
127
129
  alias :correlates? :correlated?
128
130
 
131
+ def set_property(name, value)
132
+ properties[name] = value
133
+ end
134
+
135
+ def get_property(name)
136
+ properties[name]
137
+ end
138
+
129
139
  def self.source_attribute_names
130
140
  [
131
141
  :stream_name,
@@ -25,6 +25,11 @@ module Messaging
25
25
  message_data.data = message.to_h
26
26
 
27
27
  metadata = message.metadata.to_h
28
+
29
+ if metadata[:properties].empty?
30
+ metadata[:properties] = nil
31
+ end
32
+
28
33
  metadata.delete_if { |k, v| v.nil? }
29
34
 
30
35
  message_data.metadata = metadata
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.3.0
4
+ version: 2.5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-01 00:00:00.000000000 Z
11
+ date: 2020-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-message_store