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 CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- euston-daemons (1.0.0-java)
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 (>= 1.0.0, < 2.0.0)
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)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'euston-daemons'
3
- s.version = '1.0.0'
3
+ s.version = '1.0.1'
4
4
  s.platform = 'java'
5
5
  s.authors = ['Lee Henson', 'Guy Boertje']
6
6
  s.email = ['lee.m.henson@gmail.com', 'guyboertje@gmail.com']
@@ -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
- Cqrs::RabbitMq.event_store = EventStore::Persistence::Mongodb::MongoPersistenceFactory.build
12
- Cqrs::RabbitMq.event_store.init
14
+ Euston::RabbitMq.event_store = Euston::EventStore::Persistence::Mongodb::MongoPersistenceFactory.build
15
+ Euston::RabbitMq.event_store.init
13
16
 
14
- Cqrs::Repository.event_store = EventStore::OptimisticEventStore.new Cqrs::RabbitMq.event_store
17
+ Euston::Repository.event_store = Euston::EventStore::OptimisticEventStore.new Euston::RabbitMq.event_store
@@ -10,8 +10,8 @@ module Euston
10
10
  def start
11
11
  @cli_thread = Thread.new do
12
12
  begin
13
- command_handler_bindings = Cqrs::RabbitMq::CommandHandlerBindings.new(@rmq_client)
14
- command_handler_bindings.add_namespace Cqrs::RabbitMq::CommandHandlers
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
- require_rel '../components'
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
- Cqrs::RabbitMq.read_model_mongodb = Mongo::DB.new(hash[:read_model_database], read_connection)
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 = Cqrs::RabbitMq::EventHandlerBindings.new(@channel)
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 = Cqrs::RabbitMq::EventHandlerBinding.new(chan, ns, ht)
45
+ binding = Euston::RabbitMq::EventHandlerBinding.new(chan, ns, ht)
46
46
  binding.bind
47
47
  binding.listen
48
48
  rescue => e
@@ -21,7 +21,7 @@ class RabbitMQClient
21
21
  begin
22
22
  callback :message_received, message
23
23
  msg.ack!
24
- rescue ::EventStore::ConcurrencyError
24
+ rescue Euston::EventStore::ConcurrencyError
25
25
  msg.reject! true #requeue
26
26
  rescue => e
27
27
  callback :message_failed, message, e, msg
@@ -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
- Cqrs::RabbitMq.event_store_mongodb = Mongo::DB.new event_database, event_connection
16
- Cqrs::RabbitMq.read_model_mongodb = Mongo::DB.new hash[:read_model_database], read_connection
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
- Cqrs::RabbitMq.event_store = EventStore::Persistence::Mongodb::MongoPersistenceFactory.build
22
- Cqrs::RabbitMq.event_store.init
25
+ Euston::RabbitMq.event_store = Euston::EventStore::Persistence::Mongodb::MongoPersistenceFactory.build
26
+ Euston::RabbitMq.event_store.init
23
27
 
24
- Cqrs::Repository.event_store = EventStore::OptimisticEventStore.new Cqrs::RabbitMq.event_store
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 = Cqrs::RabbitMq.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 Cqrs::RabbitMq::Exchanges
14
- include Cqrs::RabbitMq::Queues
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 = Cqrs::RabbitMq::MessageDecodeFailedError.new text
44
+ err = Euston::RabbitMq::MessageDecodeFailedError.new text
45
45
  err.set_backtrace error.backtrace
46
46
 
47
47
  Safely.report! err
@@ -11,7 +11,7 @@ module Euston
11
11
  end
12
12
  end
13
13
 
14
- include Cqrs::RabbitMq::Exchanges
14
+ include Euston::RabbitMq::Exchanges
15
15
 
16
16
  def initialize channel, exchange_name
17
17
  @read_model = Euston::MessageBufferDaemon::ReadModel::MessageBuffer.send exchange_name
@@ -4,11 +4,11 @@ module Euston
4
4
  class MessageBuffer
5
5
  class << self
6
6
  def commands
7
- self.new "buffered_commands", Cqrs::RabbitMq.read_model_mongodb
7
+ self.new "buffered_commands", Euston::RabbitMq.read_model_mongodb
8
8
  end
9
9
 
10
10
  def events
11
- self.new "buffered_events", Cqrs::RabbitMq.event_store_mongodb
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", Cqrs::RabbitMq.read_model_mongodb
7
+ self.new "command_log", Euston::RabbitMq.read_model_mongodb
8
8
  end
9
9
 
10
10
  def events
11
- self.new "event_log", Cqrs::RabbitMq.event_store_mongodb
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 Cqrs::RabbitMq::Exchanges
15
- include Cqrs::RabbitMq::Queues
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 = Cqrs::RabbitMq::MessageDecodeFailedError.new text
44
+ err = Euston::RabbitMq::MessageDecodeFailedError.new text
45
45
  err.set_backtrace error.backtrace
46
46
 
47
47
  Safely.report! err
@@ -1,5 +1,5 @@
1
1
  module Euston
2
2
  module Daemons
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -1,7 +1,9 @@
1
- if RUBY_PLATFORM.to_s == 'java'
2
- require 'logger'
3
- require 'rake/tasklib'
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()
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: euston-daemons
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.0
5
+ version: 1.0.1
6
6
  platform: java
7
7
  authors:
8
8
  - Lee Henson