Module: Messaging::Controls::Metadata

Defined in:
lib/messaging/controls/metadata.rb

Defined Under Namespace

Modules: New, Random, Written

Constant Summary collapse

Empty =
New

Class Method Summary collapse

Class Method Details

.causation_message_global_positionObject



33
34
35
# File 'lib/messaging/controls/metadata.rb', line 33

def self.causation_message_global_position
  111
end

.causation_message_identifierObject



53
54
55
# File 'lib/messaging/controls/metadata.rb', line 53

def self.causation_message_identifier
  "#{causation_message_stream_name}/#{causation_message_position}"
end

.causation_message_positionObject



29
30
31
# File 'lib/messaging/controls/metadata.rb', line 29

def self.causation_message_position
  11
end

.causation_message_stream_nameObject



25
26
27
# File 'lib/messaging/controls/metadata.rb', line 25

def self.causation_message_stream_name
  "someCausation"
end

.correlation_stream_nameObject



37
38
39
# File 'lib/messaging/controls/metadata.rb', line 37

def self.correlation_stream_name
  "someCorrelation"
end

.dataObject



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/messaging/controls/metadata.rb', line 73

def self.data
  {
    stream_name: stream_name,
    position: position,
    global_position: global_position,

    causation_message_stream_name: causation_message_stream_name,
    causation_message_position: causation_message_position,
    causation_message_global_position: causation_message_global_position,

    correlation_stream_name: correlation_stream_name,

    reply_stream_name: reply_stream_name,

    properties: Properties.example,
    local_properties: LocalProperties.example,

    time: time,

    schema_version: schema_version
  }
end

.exampleObject



4
5
6
7
8
9
10
11
# File 'lib/messaging/controls/metadata.rb', line 4

def self.example
  data = self.data

  data[:properties] = properties
  data[:local_properties] = local_properties

  Messaging::Message::Metadata.build(data)
end

.global_positionObject



21
22
23
# File 'lib/messaging/controls/metadata.rb', line 21

def self.global_position
  222
end

.identifierObject



49
50
51
# File 'lib/messaging/controls/metadata.rb', line 49

def self.identifier
  "#{stream_name}/#{position}"
end

.local_propertiesObject



69
70
71
# File 'lib/messaging/controls/metadata.rb', line 69

def self.local_properties
  LocalProperties.example
end

.positionObject



17
18
19
# File 'lib/messaging/controls/metadata.rb', line 17

def self.position
  1
end

.propertiesObject



57
58
59
# File 'lib/messaging/controls/metadata.rb', line 57

def self.properties
  Properties.example
end

.reply_stream_nameObject



41
42
43
# File 'lib/messaging/controls/metadata.rb', line 41

def self.reply_stream_name
  "someReply"
end

.schema_versionObject



45
46
47
# File 'lib/messaging/controls/metadata.rb', line 45

def self.schema_version
  '1.1'
end

.stream_nameObject



13
14
15
# File 'lib/messaging/controls/metadata.rb', line 13

def self.stream_name
  'someSource'
end

.timeObject



61
62
63
# File 'lib/messaging/controls/metadata.rb', line 61

def self.time
  Time::Raw.example
end