euston-daemons 1.0.0-java → 1.0.1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/euston-daemons.gemspec +1 -1
- data/lib/euston-daemons/command_processor_daemon/config/environment.rb +9 -6
- data/lib/euston-daemons/command_processor_daemon/lib/components/command_handler_component.rb +2 -2
- data/lib/euston-daemons/event_processor_daemon/config/environment.rb +6 -3
- data/lib/euston-daemons/event_processor_daemon/lib/components/event_handler_component.rb +2 -2
- data/lib/euston-daemons/framework/queue.rb +1 -1
- data/lib/euston-daemons/message_buffer_daemon/config/environment.rb +12 -8
- data/lib/euston-daemons/message_buffer_daemon/lib/components/event_store_component.rb +1 -1
- data/lib/euston-daemons/message_buffer_daemon/lib/message_logger.rb +3 -3
- data/lib/euston-daemons/message_buffer_daemon/lib/publisher.rb +1 -1
- data/lib/euston-daemons/message_buffer_daemon/lib/read_model/message_buffer.rb +2 -2
- data/lib/euston-daemons/message_buffer_daemon/lib/read_model/message_log.rb +2 -2
- data/lib/euston-daemons/message_buffer_daemon/lib/subscriber.rb +3 -3
- data/lib/euston-daemons/version.rb +1 -1
- data/lib/euston-daemons.rb +5 -3
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -11,7 +11,7 @@ GIT
|
|
11
11
|
PATH
|
12
12
|
remote: .
|
13
13
|
specs:
|
14
|
-
euston-daemons (1.0.
|
14
|
+
euston-daemons (1.0.1-java)
|
15
15
|
activemodel (~> 3.0.0)
|
16
16
|
activesupport (~> 3.0.0)
|
17
17
|
erb-yaml (~> 1.0.0)
|
@@ -38,7 +38,7 @@ GEM
|
|
38
38
|
builder (2.1.2)
|
39
39
|
diff-lcs (1.1.3)
|
40
40
|
erb-yaml (1.0.0)
|
41
|
-
hash-keys (
|
41
|
+
hash-keys (< 2.0.0, >= 1.0.0)
|
42
42
|
euston (1.0.0)
|
43
43
|
activesupport (~> 3.0.9)
|
44
44
|
euston-eventstore (~> 1.0.0)
|
data/euston-daemons.gemspec
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
+
require 'jessica'
|
2
|
+
require 'euston'
|
3
|
+
require 'euston-eventstore'
|
4
|
+
require 'euston-rabbitmq'
|
1
5
|
require_rel '../lib'
|
2
6
|
|
3
7
|
Safely::Strategy::Log.logger = EUSTON_LOG
|
4
|
-
Cqrs.uuid = Uuid
|
5
8
|
AMQP.settings.merge! ErbYaml.read(AMQP_CONFIG_PATH, EUSTON_ENV)
|
6
9
|
Euston::CommandProcessorDaemon::Settings.configure ErbYaml.read(DAEMON_CONFIG_PATH, EUSTON_ENV)
|
7
10
|
|
8
|
-
EventStore::Persistence::Mongodb::Config.instance.logger = EUSTON_LOG
|
9
|
-
EventStore::Persistence::Mongodb::Config.instance.database = Euston::CommandProcessorDaemon::Settings.mongo_db_name
|
11
|
+
Euston::EventStore::Persistence::Mongodb::Config.instance.logger = EUSTON_LOG
|
12
|
+
Euston::EventStore::Persistence::Mongodb::Config.instance.database = Euston::CommandProcessorDaemon::Settings.mongo_db_name
|
10
13
|
|
11
|
-
|
12
|
-
|
14
|
+
Euston::RabbitMq.event_store = Euston::EventStore::Persistence::Mongodb::MongoPersistenceFactory.build
|
15
|
+
Euston::RabbitMq.event_store.init
|
13
16
|
|
14
|
-
|
17
|
+
Euston::Repository.event_store = Euston::EventStore::OptimisticEventStore.new Euston::RabbitMq.event_store
|
data/lib/euston-daemons/command_processor_daemon/lib/components/command_handler_component.rb
CHANGED
@@ -10,8 +10,8 @@ module Euston
|
|
10
10
|
def start
|
11
11
|
@cli_thread = Thread.new do
|
12
12
|
begin
|
13
|
-
command_handler_bindings =
|
14
|
-
command_handler_bindings.add_namespace
|
13
|
+
command_handler_bindings = Euston::RabbitMq::CommandHandlerBindings.new(@rmq_client)
|
14
|
+
command_handler_bindings.add_namespace Euston::RabbitMq::CommandHandlers
|
15
15
|
|
16
16
|
if Object.const_defined? 'COMMAND_HANDLER_NAMESPACES'
|
17
17
|
COMMAND_HANDLER_NAMESPACES.each do |handler_namespace|
|
@@ -1,8 +1,11 @@
|
|
1
|
-
|
1
|
+
require 'jessica'
|
2
|
+
require 'euston'
|
3
|
+
require 'euston-eventstore'
|
4
|
+
require 'euston-rabbitmq'
|
5
|
+
|
2
6
|
require_rel '../lib'
|
3
7
|
|
4
8
|
Safely::Strategy::Log.logger = EUSTON_LOG
|
5
|
-
Cqrs.uuid = Uuid
|
6
9
|
AMQP.settings.merge! ErbYaml.read(AMQP_CONFIG_PATH, EUSTON_ENV)
|
7
10
|
Euston::EventProcessorDaemon::Settings.configure ErbYaml.read(DAEMON_CONFIG_PATH, EUSTON_ENV)
|
8
11
|
|
@@ -15,6 +18,6 @@ Mongoid.configure do |config|
|
|
15
18
|
config.logger = EUSTON_LOG
|
16
19
|
end
|
17
20
|
|
18
|
-
|
21
|
+
Euston::RabbitMq.read_model_mongodb = Mongo::DB.new(hash[:read_model_database], read_connection)
|
19
22
|
|
20
23
|
I18n.load_path += Dir[I18N_LOCALES_PATH]
|
@@ -8,7 +8,7 @@ module Euston
|
|
8
8
|
def initialize()
|
9
9
|
@channel = AMQP::Channel.new
|
10
10
|
@channel.prefetch(1)
|
11
|
-
@event_handler_bindings =
|
11
|
+
@event_handler_bindings = Euston::RabbitMq::EventHandlerBindings.new(@channel)
|
12
12
|
|
13
13
|
if Object.const_defined? 'EVENT_HANDLER_NAMESPACES'
|
14
14
|
EVENT_HANDLER_NAMESPACES.each do |handler_namespace|
|
@@ -42,7 +42,7 @@ module Euston
|
|
42
42
|
chan = AMQP::Channel.new
|
43
43
|
chan.prefetch(1)
|
44
44
|
EUSTON_LOG.debug "EventHandlerBinding for: #{ns}.#{ht}"
|
45
|
-
binding =
|
45
|
+
binding = Euston::RabbitMq::EventHandlerBinding.new(chan, ns, ht)
|
46
46
|
binding.bind
|
47
47
|
binding.listen
|
48
48
|
rescue => e
|
@@ -1,7 +1,11 @@
|
|
1
|
+
require 'jessica'
|
2
|
+
require 'euston'
|
3
|
+
require 'euston-eventstore'
|
4
|
+
require 'euston-rabbitmq'
|
5
|
+
|
1
6
|
require_rel '../lib'
|
2
7
|
|
3
8
|
Safely::Strategy::Log.logger = EUSTON_LOG
|
4
|
-
Cqrs.uuid = Uuid
|
5
9
|
AMQP.settings.merge! ErbYaml.read(AMQP_CONFIG_PATH, EUSTON_ENV)
|
6
10
|
Euston::MessageBufferDaemon::Settings.configure ErbYaml.read(DAEMON_CONFIG_PATH, EUSTON_ENV)
|
7
11
|
|
@@ -12,15 +16,15 @@ read_connection = Mongo::Connection.new hash[:host], hash[:port], :safe => hash
|
|
12
16
|
|
13
17
|
event_database = hash[:event_store_database]
|
14
18
|
|
15
|
-
|
16
|
-
|
19
|
+
Euston::RabbitMq.event_store_mongodb = Mongo::DB.new event_database, event_connection
|
20
|
+
Euston::RabbitMq.read_model_mongodb = Mongo::DB.new hash[:read_model_database], read_connection
|
17
21
|
|
18
|
-
EventStore::Persistence::Mongodb::Config.instance.logger = EUSTON_LOG
|
19
|
-
EventStore::Persistence::Mongodb::Config.instance.database = event_database
|
22
|
+
Euston::EventStore::Persistence::Mongodb::Config.instance.logger = EUSTON_LOG
|
23
|
+
Euston::EventStore::Persistence::Mongodb::Config.instance.database = event_database
|
20
24
|
|
21
|
-
|
22
|
-
|
25
|
+
Euston::RabbitMq.event_store = Euston::EventStore::Persistence::Mongodb::MongoPersistenceFactory.build
|
26
|
+
Euston::RabbitMq.event_store.init
|
23
27
|
|
24
|
-
|
28
|
+
Euston::Repository.event_store = Euston::EventStore::OptimisticEventStore.new Euston::RabbitMq.event_store
|
25
29
|
|
26
30
|
|
@@ -17,7 +17,7 @@ module Euston
|
|
17
17
|
def start
|
18
18
|
@cli_thread = Thread.new do
|
19
19
|
@event_buffer = Euston::MessageBufferDaemon::ReadModel::MessageBuffer.events
|
20
|
-
@event_store =
|
20
|
+
@event_store = Euston::RabbitMq.event_store
|
21
21
|
until Thread.current[:stop] do
|
22
22
|
begin
|
23
23
|
loop do
|
@@ -10,8 +10,8 @@ module Euston
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
include
|
14
|
-
include
|
13
|
+
include Euston::RabbitMq::Exchanges
|
14
|
+
include Euston::RabbitMq::Queues
|
15
15
|
|
16
16
|
def initialize channel, exchange_name
|
17
17
|
@channel = channel
|
@@ -41,7 +41,7 @@ module Euston
|
|
41
41
|
|
42
42
|
def log_failure message, error
|
43
43
|
text = "A log queue subscription failed. [Error] #{error.message} [Payload] #{message}"
|
44
|
-
err =
|
44
|
+
err = Euston::RabbitMq::MessageDecodeFailedError.new text
|
45
45
|
err.set_backtrace error.backtrace
|
46
46
|
|
47
47
|
Safely.report! err
|
@@ -4,11 +4,11 @@ module Euston
|
|
4
4
|
class MessageBuffer
|
5
5
|
class << self
|
6
6
|
def commands
|
7
|
-
self.new "buffered_commands",
|
7
|
+
self.new "buffered_commands", Euston::RabbitMq.read_model_mongodb
|
8
8
|
end
|
9
9
|
|
10
10
|
def events
|
11
|
-
self.new "buffered_events",
|
11
|
+
self.new "buffered_events", Euston::RabbitMq.event_store_mongodb
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -4,11 +4,11 @@ module Euston
|
|
4
4
|
class MessageLog
|
5
5
|
class << self
|
6
6
|
def commands
|
7
|
-
self.new "command_log",
|
7
|
+
self.new "command_log", Euston::RabbitMq.read_model_mongodb
|
8
8
|
end
|
9
9
|
|
10
10
|
def events
|
11
|
-
self.new "event_log",
|
11
|
+
self.new "event_log", Euston::RabbitMq.event_store_mongodb
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -11,8 +11,8 @@ module Euston
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
include
|
15
|
-
include
|
14
|
+
include Euston::RabbitMq::Exchanges
|
15
|
+
include Euston::RabbitMq::Queues
|
16
16
|
include Hollywood
|
17
17
|
|
18
18
|
def initialize channel, exchange_name
|
@@ -41,7 +41,7 @@ module Euston
|
|
41
41
|
|
42
42
|
def log_failure message, error
|
43
43
|
text = "A buffer queue subscription failed. [Error] #{error.message} [Payload] #{message}"
|
44
|
-
err =
|
44
|
+
err = Euston::RabbitMq::MessageDecodeFailedError.new text
|
45
45
|
err.set_backtrace error.backtrace
|
46
46
|
|
47
47
|
Safely.report! err
|
data/lib/euston-daemons.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
require 'hollywood'
|
2
|
+
require 'logger'
|
3
|
+
require 'rake/tasklib'
|
4
|
+
require 'require_all'
|
4
5
|
|
6
|
+
if RUBY_PLATFORM.to_s == 'java'
|
5
7
|
module Uuid
|
6
8
|
def self.generate
|
7
9
|
Java::JavaUtil::UUID.randomUUID().toString()
|