cavalle / banksimplistic Goto Github PK
View Code? Open in Web Editor NEWExploring CQRS, Event Sourcing and DDD with Ruby
Home Page: http://github.com/cavalle/banksimplistic
Exploring CQRS, Event Sourcing and DDD with Ruby
Home Page: http://github.com/cavalle/banksimplistic
Hi dude.
It seams like the config.to_prepare block in infrastructure.rb is causing me some problem when I run the rake task to subscribe on events from the amqp driver.
config.to_prepare do
Eventwire.driver = Rails.env.test? ? 'InProcess' : 'AMPQ'
end
It run the following code in eventwire.rb
def self.driver=(driver)
klass = Drivers.const_get(driver.to_sym) if driver.respond_to?(:to_sym)
@driver = klass ? klass.new : driver
end
that re-sets the @driver object. I loose the values in the object variable @subscriptions in the driver that the subscriber method already setup.
I made a work around by remove the config.to_prepare block and run the code directly. Works in my case but dont know if it's a solid solution.
Thanks so much for this project, it's really helped me get my head around this pattern.
I run up a server and start the event bus (btw - be nice to have the event bus rake task in the README). I create new clients, but they don't persist attributes properly:
> ClientReport.all.each {|x| puts x.inspect }
#<ClientReport:3 name=nil city=nil uid=nil>
#<ClientReport:4 name=nil city=nil uid=nil>
#<ClientReport:5 name=nil city=nil uid=nil>
#<ClientReport:1 name=nil city=nil uid=nil>
#<ClientReport:2 name=nil city=nil uid=nil>
=> ["3", "4", "5", "1", "2"]
This is also reflected in the test failures:
Failures:
1) Create client In order to start selling other services
As a banker
I want to sign up new clients New user sign up
Failure/Error: click_button "Create client!"
ActionView::Template::Error:
No route matches {:action=>"destroy", :controller=>"clients"}
# ./app/views/clients/index.html.erb:13:in `block in _app_views_clients_index_html_erb___1869135361368763010_2166995120_383953378302977591'
# ./app/views/clients/index.html.erb:9:in `_app_views_clients_index_html_erb___1869135361368763010_2166995120_383953378302977591'
# <internal:prelude>:10:in `synchronize'
# ./spec/acceptance/acceptance_helper.rb:25:in `block in <top (required)>'
# ./spec/acceptance/create_client_spec.rb:19:in `block (2 levels) in <top (required)>'
2) Feature name In order to do evil thing with their money
As a banker
I want clients to open accounts Client opens a new account
Failure/Error: Unable to find matching line from backtrace
NoMethodError:
undefined method `accounts' for nil:NilClass
# ./app/reports/client_details_report.rb:31:in `block in <class:ClientDetailsReport>'
# ./app/infrastructure/event_handler.rb:7:in `call'
# ./app/infrastructure/event_handler.rb:7:in `block (2 levels) in on'
# ./app/infrastructure/event_bus.rb:62:in `call'
# ./app/infrastructure/event_bus.rb:62:in `block (3 levels) in start'
# ./app/infrastructure/event_bus.rb:61:in `block (2 levels) in start'
# ./app/infrastructure/event_bus.rb:58:in `start'
# ./app/infrastructure/event_bus.rb:4:in `start'
# ./spec/acceptance/acceptance_helper.rb:12:in `block (3 levels) in <top (required)>'
3) Send Money Transfer In order for money to circulate
As a banker
I want my clients to send money transfers to other accounts Send money transfer to an internal account
Failure/Error: page.should have_content "Balance: $0"
expected #has_content?("Balance: $0") to return true, got false
# ./spec/acceptance/send_money_transfer_spec.rb:27:in `block (2 levels) in <top (required)>'
Finished in 3.21 seconds
11 examples, 3 failures
(the top one is a result of trying to render a client with a nil uid, which should never happen)
Perhaps this is a version issue with redis/ruby redis library? I don't really know anything about it. I have redis v2.0.4.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.