19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/messaging/message/transform.rb', line 19
def self.write(message)
message_data = MessageStore::MessageData::Write.build
message_data.id = message.id
message_data.type = message.message_type
message_data.data = message.to_h
metadata = message.metadata.to_h
if metadata[:properties].empty?
metadata.delete(:properties)
end
if metadata[:local_properties].empty?
metadata.delete(:local_properties)
end
metadata.delete_if { |k, v| v.nil? }
message_data.metadata = metadata
message_data
end
|