euston-daemons 1.2.6-java → 1.2.7-java

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,8 @@
1
+ if RUBY_VERSION =~ /1.9/
2
+ Encoding.default_external = Encoding::UTF_8
3
+ Encoding.default_internal = Encoding::UTF_8
4
+ end
5
+
1
6
  source :rubygems
2
7
  gemspec
3
8
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'euston-daemons'
3
- s.version = '1.2.6'
3
+ s.version = '1.2.7'
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']
@@ -62,13 +62,13 @@ Gem::Specification.new do |s|
62
62
  s.add_dependency 'activemodel', '>= 3.0.10'
63
63
  s.add_dependency 'activesupport', '>= 3.0.10'
64
64
  s.add_dependency 'erb-yaml', '~> 1.0.0'
65
- s.add_dependency 'euston', '~> 1.2.0'
66
- s.add_dependency 'euston-eventstore', '~> 1.2.0'
67
- s.add_dependency 'euston-rabbitmq', '~> 1.2.0'
65
+ s.add_dependency 'euston', '~> 1.2.4'
66
+ s.add_dependency 'euston-eventstore', '~> 1.2.3'
67
+ s.add_dependency 'euston-rabbitmq', '~> 1.2.2'
68
68
  s.add_dependency 'hollywood', '~> 1.0.0'
69
69
  s.add_dependency 'i18n', '>= 0.5.0'
70
- s.add_dependency 'macaddr', '~> 1.4.0'
71
70
  s.add_dependency 'safely', '~> 0.3.0'
71
+ s.add_dependency 'uuidtools', '~> 2.1.2'
72
72
 
73
73
  if RUBY_PLATFORM.to_s == 'java'
74
74
  s.add_dependency 'hot_bunnies', '~> 1.3.0.pre1'
@@ -80,5 +80,6 @@ Gem::Specification.new do |s|
80
80
  s.add_development_dependency 'ffaker', '~> 1.8.0'
81
81
  s.add_development_dependency 'fuubar', '~> 0.0.0'
82
82
  s.add_development_dependency 'rabbitmqadmin-cli', '~> 1.0.2'
83
+ s.add_development_dependency 'rake', '~> 0.9.2'
83
84
  s.add_development_dependency 'rspec', '~> 2.6.0'
84
85
  end
@@ -1,6 +1,6 @@
1
1
  require 'i18n'
2
2
  require 'hot_bunnies'
3
- require 'macaddr'
3
+ require 'uuidtools'
4
4
  require 'euston-rabbitmq'
5
5
 
6
6
  require 'euston-daemons/pipeline/lib/command_processor/failed_message'
@@ -40,7 +40,9 @@ module Euston
40
40
  def initialize data
41
41
  @logger = data[:logger]
42
42
  @daemon_config = data[:daemon_config]
43
- @i18n_locales_path = @daemon_config[:i18n_locales_path]
43
+ if data.has_key?(:app_root) && @daemon_config.has_key?(:i18n_locales_path)
44
+ @i18n_locales_path = File.join(data[:app_root], @daemon_config[:i18n_locales_path], "*")
45
+ end
44
46
 
45
47
  @amqp_config = ErbYaml.read data[:amqp_config_path], data[:environment]
46
48
  @mongo_config = ErbYaml.read data[:mongo_config_path], data[:environment]
@@ -68,7 +70,7 @@ module Euston
68
70
  setup_mongo @mongo_config
69
71
  setup_euston @mongo_config[:event_store_database]
70
72
 
71
- I18n.load_path += Dir[@i18n_locales_path] unless @i18n_locales_path.nil?
73
+ I18n.load_path += Dir.glob(@i18n_locales_path) unless @i18n_locales_path.nil?
72
74
 
73
75
  self.class
74
76
  end
@@ -49,13 +49,13 @@ module Euston
49
49
  end
50
50
 
51
51
  (1..env.event_store_dispatchers).each do |i|
52
- component = EventStoreDispatcher::Component.new env.amqp_connection.create_channel, "#{Mac.addr.to_s} #{i}", @log
52
+ component = EventStoreDispatcher::Component.new env.amqp_connection.create_channel, "#{UUIDTools::UUID.mac_address} #{i}", @log
53
53
  component = register_component "event_store_dispatcher_#{i}", component
54
54
  component.wait_time = env.event_store_dispatcher_wait_time
55
55
  end
56
56
 
57
57
  (1..env.message_buffers).each do |i|
58
- component = MessageBuffer::Component.new env.amqp_connection.create_channel, "#{Mac.addr.to_s} #{i}", @log
58
+ component = MessageBuffer::Component.new env.amqp_connection.create_channel, "#{UUIDTools::UUID.mac_address} #{i}", @log
59
59
  component = register_component "message_buffer_#{i}", component
60
60
  component.wait_time = env.message_buffer_wait_time
61
61
  end
@@ -5,7 +5,8 @@ module Euston
5
5
  :daemon_config_path,
6
6
  :event_handler_namespaces,
7
7
  :mongo_config_path,
8
- :user_defined_components
8
+ :user_defined_components,
9
+ :app_root
9
10
 
10
11
  def initialize environment
11
12
  super(environment, :pipeline_daemon)
@@ -37,6 +38,9 @@ module Euston
37
38
 
38
39
  @logger.debug "User-defined components: #{@user_defined_components.count}"
39
40
  @data[:user_defined_components] = @user_defined_components.to_a.flatten
41
+
42
+ @logger.debug "App root: #{@app_root}"
43
+ @data[:app_root] = @app_root
40
44
  end
41
45
 
42
46
  def load_environment
@@ -1,5 +1,5 @@
1
1
  module Euston
2
2
  module Daemons
3
- VERSION = "1.2.6"
3
+ VERSION = "1.2.7"
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@ describe 'event handler client', :purge_event_store, :purge_rabbitmq do
3
3
 
4
4
  let(:logger) { Euston::NullLogger.instance }
5
5
  let(:subscription) { StubRetryingSubscription.new }
6
- let(:client) { Euston::Daemons::Pipeline::EventProcessor::Component.new @channel, reference, 1, logger }
6
+ let(:client) { Euston::Daemons::Pipeline::EventProcessor::Component.new @channel, [reference], 1, logger }
7
7
  let(:aggregate) { Euston::Daemons::SampleModel::Counter2.new }
8
8
  let(:saved_aggregates) { [] }
9
9
 
@@ -21,7 +21,7 @@ describe 'event handler client', :purge_event_store, :purge_rabbitmq do
21
21
  :type => :external_thing_happened,
22
22
  :timestamp => Time.now.to_f,
23
23
  :version => 1 },
24
- :body => {} }
24
+ :body => { :id => Uuid.generate } }
25
25
 
26
26
  subscription.stub_message_receipt event
27
27
  end
@@ -21,7 +21,7 @@ describe 'message buffer component', :purge_event_store do
21
21
 
22
22
  before do
23
23
  Euston::DaemonEnvironment.event_store_mongodb = @event_store_database
24
- channel.stub(:topic) { exchange }
24
+ channel.stub(:exchange) { exchange }
25
25
  exchange.stub(:name) { 'commands' }
26
26
  exchange.stub(:publish) { |json, options| published << { :json => json, :options => options } }
27
27
  end
@@ -43,7 +43,6 @@ describe 'message buffer component', :purge_event_store do
43
43
  end
44
44
 
45
45
  context 'there is a due command' do
46
-
47
46
  before do
48
47
  buffer.enqueue :commands, command
49
48
  end
data/spec/spec_helper.rb CHANGED
@@ -75,6 +75,8 @@ RSpec.configure do |config|
75
75
  end
76
76
 
77
77
  config.before(:all, :purge_rabbitmq) do
78
+ initialize_rabbitmq amqp_config
79
+
78
80
  @amqp_connection = HotBunnies.connect amqp_config
79
81
 
80
82
  initialize_amqp @amqp_connection
@@ -1,6 +1,7 @@
1
1
  class StubRetryingSubscription
2
2
  include Hollywood
3
3
 
4
+ def get; end
4
5
  def subscribe; end
5
6
 
6
7
  def stub_message_receipt message
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.6
5
+ version: 1.2.7
6
6
  platform: java
7
7
  authors:
8
8
  - Lee Henson
@@ -10,205 +10,215 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-11-01 00:00:00.000000000 +00:00
14
- default_executable:
13
+ date: 2011-12-01 00:00:00.000000000Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: activemodel
18
- version_requirements: &2258 !ruby/object:Gem::Requirement
17
+ version_requirements: &2058 !ruby/object:Gem::Requirement
19
18
  requirements:
20
19
  - - ! '>='
21
20
  - !ruby/object:Gem::Version
22
21
  version: 3.0.10
23
22
  none: false
24
- requirement: *2258
23
+ requirement: *2058
25
24
  prerelease: false
26
25
  type: :runtime
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: activesupport
29
- version_requirements: &2276 !ruby/object:Gem::Requirement
28
+ version_requirements: &2076 !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ! '>='
32
31
  - !ruby/object:Gem::Version
33
32
  version: 3.0.10
34
33
  none: false
35
- requirement: *2276
34
+ requirement: *2076
36
35
  prerelease: false
37
36
  type: :runtime
38
37
  - !ruby/object:Gem::Dependency
39
38
  name: erb-yaml
40
- version_requirements: &2292 !ruby/object:Gem::Requirement
39
+ version_requirements: &2092 !ruby/object:Gem::Requirement
41
40
  requirements:
42
41
  - - ~>
43
42
  - !ruby/object:Gem::Version
44
43
  version: 1.0.0
45
44
  none: false
46
- requirement: *2292
45
+ requirement: *2092
47
46
  prerelease: false
48
47
  type: :runtime
49
48
  - !ruby/object:Gem::Dependency
50
49
  name: euston
51
- version_requirements: &2308 !ruby/object:Gem::Requirement
50
+ version_requirements: &2108 !ruby/object:Gem::Requirement
52
51
  requirements:
53
52
  - - ~>
54
53
  - !ruby/object:Gem::Version
55
- version: 1.2.0
54
+ version: 1.2.4
56
55
  none: false
57
- requirement: *2308
56
+ requirement: *2108
58
57
  prerelease: false
59
58
  type: :runtime
60
59
  - !ruby/object:Gem::Dependency
61
60
  name: euston-eventstore
62
- version_requirements: &2324 !ruby/object:Gem::Requirement
61
+ version_requirements: &2124 !ruby/object:Gem::Requirement
63
62
  requirements:
64
63
  - - ~>
65
64
  - !ruby/object:Gem::Version
66
- version: 1.2.0
65
+ version: 1.2.3
67
66
  none: false
68
- requirement: *2324
67
+ requirement: *2124
69
68
  prerelease: false
70
69
  type: :runtime
71
70
  - !ruby/object:Gem::Dependency
72
71
  name: euston-rabbitmq
73
- version_requirements: &2340 !ruby/object:Gem::Requirement
72
+ version_requirements: &2140 !ruby/object:Gem::Requirement
74
73
  requirements:
75
74
  - - ~>
76
75
  - !ruby/object:Gem::Version
77
- version: 1.2.0
76
+ version: 1.2.2
78
77
  none: false
79
- requirement: *2340
78
+ requirement: *2140
80
79
  prerelease: false
81
80
  type: :runtime
82
81
  - !ruby/object:Gem::Dependency
83
82
  name: hollywood
84
- version_requirements: &2356 !ruby/object:Gem::Requirement
83
+ version_requirements: &2156 !ruby/object:Gem::Requirement
85
84
  requirements:
86
85
  - - ~>
87
86
  - !ruby/object:Gem::Version
88
87
  version: 1.0.0
89
88
  none: false
90
- requirement: *2356
89
+ requirement: *2156
91
90
  prerelease: false
92
91
  type: :runtime
93
92
  - !ruby/object:Gem::Dependency
94
93
  name: i18n
95
- version_requirements: &2372 !ruby/object:Gem::Requirement
94
+ version_requirements: &2172 !ruby/object:Gem::Requirement
96
95
  requirements:
97
96
  - - ! '>='
98
97
  - !ruby/object:Gem::Version
99
98
  version: 0.5.0
100
99
  none: false
101
- requirement: *2372
100
+ requirement: *2172
102
101
  prerelease: false
103
102
  type: :runtime
104
103
  - !ruby/object:Gem::Dependency
105
- name: macaddr
106
- version_requirements: &2388 !ruby/object:Gem::Requirement
104
+ name: safely
105
+ version_requirements: &2188 !ruby/object:Gem::Requirement
107
106
  requirements:
108
107
  - - ~>
109
108
  - !ruby/object:Gem::Version
110
- version: 1.4.0
109
+ version: 0.3.0
111
110
  none: false
112
- requirement: *2388
111
+ requirement: *2188
113
112
  prerelease: false
114
113
  type: :runtime
115
114
  - !ruby/object:Gem::Dependency
116
- name: safely
117
- version_requirements: &2404 !ruby/object:Gem::Requirement
115
+ name: uuidtools
116
+ version_requirements: &2204 !ruby/object:Gem::Requirement
118
117
  requirements:
119
118
  - - ~>
120
119
  - !ruby/object:Gem::Version
121
- version: 0.3.0
120
+ version: 2.1.2
122
121
  none: false
123
- requirement: *2404
122
+ requirement: *2204
124
123
  prerelease: false
125
124
  type: :runtime
126
125
  - !ruby/object:Gem::Dependency
127
126
  name: hot_bunnies
128
- version_requirements: &2420 !ruby/object:Gem::Requirement
127
+ version_requirements: &2220 !ruby/object:Gem::Requirement
129
128
  requirements:
130
129
  - - ~>
131
130
  - !ruby/object:Gem::Version
132
131
  version: 1.3.0.pre1
133
132
  none: false
134
- requirement: *2420
133
+ requirement: *2220
135
134
  prerelease: false
136
135
  type: :runtime
137
136
  - !ruby/object:Gem::Dependency
138
137
  name: jmongo
139
- version_requirements: &2436 !ruby/object:Gem::Requirement
138
+ version_requirements: &2236 !ruby/object:Gem::Requirement
140
139
  requirements:
141
140
  - - ~>
142
141
  - !ruby/object:Gem::Version
143
142
  version: 1.1.0
144
143
  none: false
145
- requirement: *2436
144
+ requirement: *2236
146
145
  prerelease: false
147
146
  type: :runtime
148
147
  - !ruby/object:Gem::Dependency
149
148
  name: awesome_print
150
- version_requirements: &2452 !ruby/object:Gem::Requirement
149
+ version_requirements: &2252 !ruby/object:Gem::Requirement
151
150
  requirements:
152
151
  - - ~>
153
152
  - !ruby/object:Gem::Version
154
153
  version: 0.4.0
155
154
  none: false
156
- requirement: *2452
155
+ requirement: *2252
157
156
  prerelease: false
158
157
  type: :development
159
158
  - !ruby/object:Gem::Dependency
160
159
  name: cranky
161
- version_requirements: &2470 !ruby/object:Gem::Requirement
160
+ version_requirements: &2270 !ruby/object:Gem::Requirement
162
161
  requirements:
163
162
  - - ~>
164
163
  - !ruby/object:Gem::Version
165
164
  version: 0.2.0
166
165
  none: false
167
- requirement: *2470
166
+ requirement: *2270
168
167
  prerelease: false
169
168
  type: :development
170
169
  - !ruby/object:Gem::Dependency
171
170
  name: ffaker
172
- version_requirements: &2486 !ruby/object:Gem::Requirement
171
+ version_requirements: &2286 !ruby/object:Gem::Requirement
173
172
  requirements:
174
173
  - - ~>
175
174
  - !ruby/object:Gem::Version
176
175
  version: 1.8.0
177
176
  none: false
178
- requirement: *2486
177
+ requirement: *2286
179
178
  prerelease: false
180
179
  type: :development
181
180
  - !ruby/object:Gem::Dependency
182
181
  name: fuubar
183
- version_requirements: &2502 !ruby/object:Gem::Requirement
182
+ version_requirements: &2302 !ruby/object:Gem::Requirement
184
183
  requirements:
185
184
  - - ~>
186
185
  - !ruby/object:Gem::Version
187
186
  version: 0.0.0
188
187
  none: false
189
- requirement: *2502
188
+ requirement: *2302
190
189
  prerelease: false
191
190
  type: :development
192
191
  - !ruby/object:Gem::Dependency
193
192
  name: rabbitmqadmin-cli
194
- version_requirements: &2518 !ruby/object:Gem::Requirement
193
+ version_requirements: &2318 !ruby/object:Gem::Requirement
195
194
  requirements:
196
195
  - - ~>
197
196
  - !ruby/object:Gem::Version
198
197
  version: 1.0.2
199
198
  none: false
200
- requirement: *2518
199
+ requirement: *2318
200
+ prerelease: false
201
+ type: :development
202
+ - !ruby/object:Gem::Dependency
203
+ name: rake
204
+ version_requirements: &2334 !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ~>
207
+ - !ruby/object:Gem::Version
208
+ version: 0.9.2
209
+ none: false
210
+ requirement: *2334
201
211
  prerelease: false
202
212
  type: :development
203
213
  - !ruby/object:Gem::Dependency
204
214
  name: rspec
205
- version_requirements: &2534 !ruby/object:Gem::Requirement
215
+ version_requirements: &2350 !ruby/object:Gem::Requirement
206
216
  requirements:
207
217
  - - ~>
208
218
  - !ruby/object:Gem::Version
209
219
  version: 2.6.0
210
220
  none: false
211
- requirement: *2534
221
+ requirement: *2350
212
222
  prerelease: false
213
223
  type: :development
214
224
  description: ''
@@ -262,7 +272,6 @@ files:
262
272
  - spec/support/sample_model/counter.rb
263
273
  - spec/support/sample_model/counter2.rb
264
274
  - spec/support/stub_retrying_subscription.rb
265
- has_rdoc: true
266
275
  homepage: http://github.com/leemhenson/euston-daemons
267
276
  licenses: []
268
277
  post_install_message:
@@ -283,9 +292,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
292
  none: false
284
293
  requirements: []
285
294
  rubyforge_project:
286
- rubygems_version: 1.5.1
295
+ rubygems_version: 1.8.9
287
296
  signing_key:
288
297
  specification_version: 3
289
298
  summary: Message buffer, command processor and event processor daemons for Euston-RabbitMq
290
- test_files: []
299
+ test_files:
300
+ - spec/daemons/command_processor_spec.rb
301
+ - spec/daemons/event_processor_spec.rb
302
+ - spec/daemons/message_buffer_spec.rb
303
+ - spec/daemons/snapshotter_spec.rb
304
+ - spec/spec_helper.rb
305
+ - spec/support/factories/commands.rb
306
+ - spec/support/factories/commit.rb
307
+ - spec/support/factories/event_message.rb
308
+ - spec/support/factories/events.rb
309
+ - spec/support/filters.rb
310
+ - spec/support/sample_model/commands.rb
311
+ - spec/support/sample_model/counter.rb
312
+ - spec/support/sample_model/counter2.rb
313
+ - spec/support/stub_retrying_subscription.rb
291
314
  ...