euston-daemons 1.2.0-java → 1.2.1-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'euston-daemons'
3
- s.version = '1.2.0'
3
+ s.version = '1.2.1'
4
4
  s.platform = RUBY_PLATFORM.to_s == 'java' ? 'java' : Gem::Platform::RUBY
5
5
  s.authors = ['Lee Henson', 'Guy Boertje']
6
6
  s.email = ['lee.m.henson@gmail.com', 'guyboertje@gmail.com']
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  lib/euston-daemons/pipeline/lib/command_logger/component.rb
26
26
  lib/euston-daemons/pipeline/lib/command_logger/log.rb
27
27
  lib/euston-daemons/pipeline/lib/command_processor/component.rb
28
+ lib/euston-daemons/pipeline/lib/command_processor/default_commands/retry_failed_message.rb
28
29
  lib/euston-daemons/pipeline/lib/command_processor/default_handlers/retry_failed_message.rb
29
30
  lib/euston-daemons/pipeline/lib/command_processor/failed_message.rb
30
31
  lib/euston-daemons/pipeline/lib/daemon.rb
@@ -58,14 +59,14 @@ Gem::Specification.new do |s|
58
59
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
59
60
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
60
61
 
61
- s.add_dependency 'activemodel', '~> 3.0.0'
62
- s.add_dependency 'activesupport', '~> 3.0.0'
62
+ s.add_dependency 'activemodel', '>= 3.0.10'
63
+ s.add_dependency 'activesupport', '>= 3.0.10'
63
64
  s.add_dependency 'erb-yaml', '~> 1.0.0'
64
65
  s.add_dependency 'euston', '~> 1.2.0'
65
66
  s.add_dependency 'euston-eventstore', '~> 1.2.0'
66
67
  s.add_dependency 'euston-rabbitmq', '~> 1.2.0'
67
68
  s.add_dependency 'hollywood', '~> 1.0.0'
68
- s.add_dependency 'i18n', '~> 0.5.0'
69
+ s.add_dependency 'i18n', '>= 0.5.0'
69
70
  s.add_dependency 'macaddr', '~> 1.4.0'
70
71
  s.add_dependency 'safely', '~> 0.3.0'
71
72
 
@@ -24,6 +24,7 @@ module Euston
24
24
  attr_accessor :command_processors,
25
25
  :command_handler_namespaces,
26
26
  :command_loggers,
27
+ :command_log_ignores,
27
28
  :event_handler_namespaces,
28
29
  :event_processors,
29
30
  :event_store_dispatchers,
@@ -32,7 +33,8 @@ module Euston
32
33
  :message_buffer_wait_time,
33
34
  :snapshotters,
34
35
  :snapshotter_wait_time,
35
- :snapshot_threshold
36
+ :snapshot_threshold,
37
+ :user_defined_components
36
38
  end
37
39
 
38
40
  def initialize data
@@ -45,9 +47,11 @@ module Euston
45
47
 
46
48
  self.class.command_handler_namespaces = data[:command_handler_namespaces]
47
49
  self.class.event_handler_namespaces = data[:event_handler_namespaces]
50
+ self.class.user_defined_components = data[:user_defined_components]
48
51
 
49
52
  self.class.command_processors = @daemon_config[:command_processors].to_i
50
53
  self.class.command_loggers = @daemon_config[:command_loggers].to_i
54
+ self.class.command_log_ignores = @daemon_config[:command_log_ignores]
51
55
  self.class.event_processors = @daemon_config[:event_processors].to_i
52
56
  self.class.event_store_dispatchers = @daemon_config[:event_store_dispatchers].to_i
53
57
  self.class.event_store_dispatcher_wait_time = @daemon_config[:event_store_dispatcher_wait_time].to_f
@@ -45,7 +45,7 @@ module Euston
45
45
  end
46
46
 
47
47
  def write_message_to_log message
48
- @command_log.write_command message
48
+ @command_log.write_command message unless DaemonEnvironment.command_log_ignores.include? message[:headers][:type]
49
49
  end
50
50
  end
51
51
  end
@@ -0,0 +1,13 @@
1
+ module Euston
2
+ module Daemons
3
+ module Pipeline
4
+ module CommandProcessor
5
+ module DefaultCommands
6
+ class RetryFailedMessage < Euston::Command
7
+ validates :id, :presence => true, :format => { :with => /^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$/ }
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -45,7 +45,7 @@ module Euston
45
45
 
46
46
  (1..env.command_processors).each do |i|
47
47
  component = CommandProcessor::Component.new env.amqp_connection.create_channel, @command_handler_references, i, @log
48
- register_component "command_processor_#{i}".to_sym, component
48
+ register_component "command_processor_#{i}", component
49
49
  end
50
50
 
51
51
  (1..env.event_store_dispatchers).each do |i|
@@ -68,7 +68,15 @@ module Euston
68
68
 
69
69
  (1..env.event_processors).each do |i|
70
70
  component = EventProcessor::Component.new env.amqp_connection.create_channel, @event_handler_references, i, @log
71
- register_component "event_processor_#{i}".to_sym, component
71
+ register_component "event_processor_#{i}", component
72
+ end
73
+
74
+ env.user_defined_components.each do |udc|
75
+ udc[:quantity].times do |i|
76
+ component = udc[:factory_method].call env, i, @log
77
+ component = register_component "#{udc[:name]}_#{i}", component
78
+ component.wait_time = udc[:wait_time] || 0.2
79
+ end
72
80
  end
73
81
  end
74
82
  end
@@ -4,7 +4,8 @@ module Euston
4
4
  :command_handler_namespaces,
5
5
  :daemon_config_path,
6
6
  :event_handler_namespaces,
7
- :mongo_config_path
7
+ :mongo_config_path,
8
+ :user_defined_components
8
9
 
9
10
  def initialize environment
10
11
  super(environment, :pipeline_daemon)
@@ -33,6 +34,9 @@ module Euston
33
34
 
34
35
  @logger.debug "Mongo config path: #{@mongo_config_path}"
35
36
  @data[:mongo_config_path] = @mongo_config_path
37
+
38
+ @logger.debug "User-defined components: #{@user_defined_components.count}"
39
+ @data[:user_defined_components] = @user_defined_components.to_a.flatten
36
40
  end
37
41
 
38
42
  def load_environment
@@ -1,5 +1,5 @@
1
1
  module Euston
2
2
  module Daemons
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
4
4
  end
5
5
  end
@@ -8,11 +8,17 @@ if RUBY_PLATFORM.to_s == 'java'
8
8
  Java::JavaUtil::UUID.randomUUID().toString()
9
9
  end
10
10
  end
11
+
12
+ require 'euston-daemons/euston/stopwatch'
13
+ require 'euston-daemons/euston/exceptions'
14
+ require 'euston-daemons/euston/daemon_environment'
15
+ require 'euston-daemons/euston/daemon_component'
16
+ require 'euston-daemons/euston/daemon_component_host'
17
+ require 'euston-daemons/euston/daemon'
18
+ else
19
+ require 'euston-daemons/pipeline/lib/command_processor/default_commands/retry_failed_message'
20
+ require 'euston-daemons/pipeline/lib/command_processor/failed_message'
21
+ require 'euston-daemons/pipeline/lib/message_buffer/buffer'
11
22
  end
12
23
 
13
- require 'euston-daemons/euston/stopwatch'
14
- require 'euston-daemons/euston/exceptions'
15
- require 'euston-daemons/euston/daemon_environment'
16
- require 'euston-daemons/euston/daemon_component'
17
- require 'euston-daemons/euston/daemon_component_host'
18
- require 'euston-daemons/euston/daemon'
24
+
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: euston-daemons
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.0
5
+ version: 1.2.1
6
6
  platform: java
7
7
  authors:
8
8
  - Lee Henson
@@ -10,205 +10,205 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-10-12 00:00:00.000000000 +01:00
13
+ date: 2011-10-18 00:00:00.000000000 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activemodel
18
- version_requirements: &2216 !ruby/object:Gem::Requirement
18
+ version_requirements: &2230 !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - ~>
20
+ - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
- version: 3.0.0
22
+ version: 3.0.10
23
23
  none: false
24
- requirement: *2216
24
+ requirement: *2230
25
25
  prerelease: false
26
26
  type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
- version_requirements: &2234 !ruby/object:Gem::Requirement
29
+ version_requirements: &2248 !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.0.0
33
+ version: 3.0.10
34
34
  none: false
35
- requirement: *2234
35
+ requirement: *2248
36
36
  prerelease: false
37
37
  type: :runtime
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: erb-yaml
40
- version_requirements: &2250 !ruby/object:Gem::Requirement
40
+ version_requirements: &2264 !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - ~>
43
43
  - !ruby/object:Gem::Version
44
44
  version: 1.0.0
45
45
  none: false
46
- requirement: *2250
46
+ requirement: *2264
47
47
  prerelease: false
48
48
  type: :runtime
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: euston
51
- version_requirements: &2266 !ruby/object:Gem::Requirement
51
+ version_requirements: &2280 !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ~>
54
54
  - !ruby/object:Gem::Version
55
55
  version: 1.2.0
56
56
  none: false
57
- requirement: *2266
57
+ requirement: *2280
58
58
  prerelease: false
59
59
  type: :runtime
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: euston-eventstore
62
- version_requirements: &2282 !ruby/object:Gem::Requirement
62
+ version_requirements: &2296 !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ~>
65
65
  - !ruby/object:Gem::Version
66
66
  version: 1.2.0
67
67
  none: false
68
- requirement: *2282
68
+ requirement: *2296
69
69
  prerelease: false
70
70
  type: :runtime
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: euston-rabbitmq
73
- version_requirements: &2298 !ruby/object:Gem::Requirement
73
+ version_requirements: &2312 !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
77
  version: 1.2.0
78
78
  none: false
79
- requirement: *2298
79
+ requirement: *2312
80
80
  prerelease: false
81
81
  type: :runtime
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: hollywood
84
- version_requirements: &2314 !ruby/object:Gem::Requirement
84
+ version_requirements: &2328 !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ~>
87
87
  - !ruby/object:Gem::Version
88
88
  version: 1.0.0
89
89
  none: false
90
- requirement: *2314
90
+ requirement: *2328
91
91
  prerelease: false
92
92
  type: :runtime
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: i18n
95
- version_requirements: &2330 !ruby/object:Gem::Requirement
95
+ version_requirements: &2344 !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ~>
97
+ - - ! '>='
98
98
  - !ruby/object:Gem::Version
99
99
  version: 0.5.0
100
100
  none: false
101
- requirement: *2330
101
+ requirement: *2344
102
102
  prerelease: false
103
103
  type: :runtime
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: macaddr
106
- version_requirements: &2346 !ruby/object:Gem::Requirement
106
+ version_requirements: &2360 !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.4.0
111
111
  none: false
112
- requirement: *2346
112
+ requirement: *2360
113
113
  prerelease: false
114
114
  type: :runtime
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: safely
117
- version_requirements: &2362 !ruby/object:Gem::Requirement
117
+ version_requirements: &2376 !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - ~>
120
120
  - !ruby/object:Gem::Version
121
121
  version: 0.3.0
122
122
  none: false
123
- requirement: *2362
123
+ requirement: *2376
124
124
  prerelease: false
125
125
  type: :runtime
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: hot_bunnies
128
- version_requirements: &2378 !ruby/object:Gem::Requirement
128
+ version_requirements: &2392 !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - ~>
131
131
  - !ruby/object:Gem::Version
132
132
  version: 1.3.0.pre1
133
133
  none: false
134
- requirement: *2378
134
+ requirement: *2392
135
135
  prerelease: false
136
136
  type: :runtime
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: jmongo
139
- version_requirements: &2394 !ruby/object:Gem::Requirement
139
+ version_requirements: &2408 !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ~>
142
142
  - !ruby/object:Gem::Version
143
143
  version: 1.1.0
144
144
  none: false
145
- requirement: *2394
145
+ requirement: *2408
146
146
  prerelease: false
147
147
  type: :runtime
148
148
  - !ruby/object:Gem::Dependency
149
149
  name: awesome_print
150
- version_requirements: &2410 !ruby/object:Gem::Requirement
150
+ version_requirements: &2424 !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - ~>
153
153
  - !ruby/object:Gem::Version
154
154
  version: 0.4.0
155
155
  none: false
156
- requirement: *2410
156
+ requirement: *2424
157
157
  prerelease: false
158
158
  type: :development
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: cranky
161
- version_requirements: &2428 !ruby/object:Gem::Requirement
161
+ version_requirements: &2442 !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - ~>
164
164
  - !ruby/object:Gem::Version
165
165
  version: 0.2.0
166
166
  none: false
167
- requirement: *2428
167
+ requirement: *2442
168
168
  prerelease: false
169
169
  type: :development
170
170
  - !ruby/object:Gem::Dependency
171
171
  name: ffaker
172
- version_requirements: &2444 !ruby/object:Gem::Requirement
172
+ version_requirements: &2458 !ruby/object:Gem::Requirement
173
173
  requirements:
174
174
  - - ~>
175
175
  - !ruby/object:Gem::Version
176
176
  version: 1.8.0
177
177
  none: false
178
- requirement: *2444
178
+ requirement: *2458
179
179
  prerelease: false
180
180
  type: :development
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: fuubar
183
- version_requirements: &2460 !ruby/object:Gem::Requirement
183
+ version_requirements: &2474 !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ~>
186
186
  - !ruby/object:Gem::Version
187
187
  version: 0.0.0
188
188
  none: false
189
- requirement: *2460
189
+ requirement: *2474
190
190
  prerelease: false
191
191
  type: :development
192
192
  - !ruby/object:Gem::Dependency
193
193
  name: rabbitmqadmin-cli
194
- version_requirements: &2476 !ruby/object:Gem::Requirement
194
+ version_requirements: &2490 !ruby/object:Gem::Requirement
195
195
  requirements:
196
196
  - - ~>
197
197
  - !ruby/object:Gem::Version
198
198
  version: 1.0.2
199
199
  none: false
200
- requirement: *2476
200
+ requirement: *2490
201
201
  prerelease: false
202
202
  type: :development
203
203
  - !ruby/object:Gem::Dependency
204
204
  name: rspec
205
- version_requirements: &2492 !ruby/object:Gem::Requirement
205
+ version_requirements: &2506 !ruby/object:Gem::Requirement
206
206
  requirements:
207
207
  - - ~>
208
208
  - !ruby/object:Gem::Version
209
209
  version: 2.6.0
210
210
  none: false
211
- requirement: *2492
211
+ requirement: *2506
212
212
  prerelease: false
213
213
  type: :development
214
214
  description: ''
@@ -234,6 +234,7 @@ files:
234
234
  - lib/euston-daemons/pipeline/lib/command_logger/component.rb
235
235
  - lib/euston-daemons/pipeline/lib/command_logger/log.rb
236
236
  - lib/euston-daemons/pipeline/lib/command_processor/component.rb
237
+ - lib/euston-daemons/pipeline/lib/command_processor/default_commands/retry_failed_message.rb
237
238
  - lib/euston-daemons/pipeline/lib/command_processor/default_handlers/retry_failed_message.rb
238
239
  - lib/euston-daemons/pipeline/lib/command_processor/failed_message.rb
239
240
  - lib/euston-daemons/pipeline/lib/daemon.rb