Hi Kenneth,
I just pulled the latest code from github for ruote-amqp and daemon-
kit, regenerated my ruote agent using the new DK, and ran into some
problems with my test script:
----------
test script:
#!/usr/bin/env ruby
require 'rubygems'
require 'ruote-amqp'
require 'ruote-amqp/participant'
require 'ruote'
require 'ruote/storage/fs_storage'
require 'ruote/storage/hash_storage'
AMQP.settings[:logging] = false
puts AMQP.settings.inspect
engine = Ruote::Engine.new(
Ruote::Worker.new(
Ruote::FsStorage.new('ruote_work')
# Ruote::HashStorage.new()
)
)
listener = RuoteAMQP::WorkitemListener.new(engine)
pdef = Ruote.process_definition :name => 'print_quote' do
cursor do
# requestor
# reviewer
# approver
amqp :queue => 'work1', :command => '/sample/quote'
end
end
engine.register_participant :requestor do |workitem|
puts "submitting forms"
puts "workitem = #{workitem.inspect}"
end
engine.register_participant :reviewer do |workitem|
puts "reviewing forms"
puts "workitem = #{workitem.inspect}"
end
engine.register_participant :approver do |workitem|
puts "approving request"
puts "workitem = #{workitem.inspect}"
end
engine.register_participant(:amqp, RuoteAMQP::Participant)
fei = engine.launch(pdef)
engine.wait_for(fei)
===
test script output:
$ ruby ruote-amqp_test.rb
{:pass=>"guest", :ssl=>false, :host=>"127.0.0.1", :port=>5672, :timeout=>nil,
:user=>"guest", :logging=>false, :vhost=>"/"}
====
agent output:
$ bin/ruote
[daemon-kit]: DaemonKit (0.1.8rc3) booting in development mode
[daemon-kit]: Setting up trap for USR1
[daemon-kit]: Setting up trap for USR2
[daemon-kit]: Setting up trap for HUP
[daemon-kit]: Setting up trap for INT
[daemon-kit]: Setting up trap for TERM
[daemon-kit]: DaemonKit (0.1.8rc3) booted, now running ruote
[daemon-kit]:
AMQP.start({:user=>"guest", :pass=>"guest", :host=>"localhost", :vhost=>"/"})
[daemon-kit]: Subscribing to work1 for workitems
[daemon-kit]: Received workitem: "{\"participant_name\":\"amqp\",
\"fields\":{\"dispatched_at\":\"2010-05-05 05:27:59.572478 UTC\",
\"params\":{\"command\":\"/sample/quote\",\"reply_queue\":
\"ruote_workitems\",\"queue\":\"work1\",\"ref\":\"amqp\"}},\"fei\":
{\"sub_wfid\":null,\"wfid\":\"20100505-bonuyunodu\",\"engine_id\":
\"engine\",\"expid\":\"0_0_0\"}}"
[daemon-kit]: Workitem cannot be processes: quote not exposed by
#<Sample:0x101052920>
[daemon-kit]: Safety net caught exception: undefined method `[]=' for
nil:NilClass
[daemon-kit]: Backtrace: /Library/Ruby/Gems/1.8/gems/daemon-
kit-0.1.8rc3/lib/daemon_kit/ruote_workitem.rb:63:in `process'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
ruote_participants.rb:98:in `run_amqp!'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
safety.rb:49:in `call'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
safety.rb:49:in `run'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
safety.rb:30:in `run'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
safety.rb:78:in `safely'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
ruote_participants.rb:95:in `run_amqp!'
/Library/Ruby/Gems/1.8/gems/amqp-0.6.7/lib/mq/queue.rb:391:in
`call'
/Library/Ruby/Gems/1.8/gems/amqp-0.6.7/lib/mq/queue.rb:391:in
`receive'
/Library/Ruby/Gems/1.8/gems/amqp-0.6.7/lib/mq.rb:171:in
`process_frame'
/Library/Ruby/Gems/1.8/gems/amqp-0.6.7/lib/amqp/client.rb:9:in
`process_frame'
/Library/Ruby/Gems/1.8/gems/amqp-0.6.7/lib/amqp/client.rb:117:in
`receive_data'
/Library/Ruby/Gems/1.8/gems/eventmachine-0.12.10/lib/
eventmachine.rb:256:in `run_machine'
/Library/Ruby/Gems/1.8/gems/eventmachine-0.12.10/lib/
eventmachine.rb:256:in `run'
/Library/Ruby/Gems/1.8/gems/amqp-0.6.7/lib/amqp.rb:79:in `start'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
amqp.rb:36:in `run'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
amqp.rb:21:in `run'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
ruote_participants.rb:86:in `run_amqp!'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
ruote_participants.rb:80:in `run'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
ruote_participants.rb:17:in `run'
/Users/edennis/Code/testing/daemonkit-testing/ruote/libexec/ruote-
daemon.rb:31
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
application.rb:38:in `require'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
application.rb:38:in `run'
/Library/Ruby/Gems/1.8/gems/daemon-kit-0.1.8rc3/lib/daemon_kit/
application.rb:21:in `exec'
bin/ruote:8
----------
Let me know if you need any further info from my side.
On May 4, 9:55 pm, John Mettraux <[email protected]> wrote:
> On Wed, May 05, 2010 at 12:45:34AM +0200, Kenneth Kalmer wrote:
>
> > The upcoming ruote-amqp-2.1.6 & daemon-kit-0.1.8rc3 are now talking to each
> > other again just fine, thanks to David Austin, John & Eric for getting the
> > debugging and fixing done.
>
> Hello Kenneth,
>
> quick note, what about ruote-amqp 2.1.10 ? Are you working with ruote 2.1.6 ?
>
> I try to go hand in hand with ruote and all the ruote-xxx. Wdyt ?
>
> > However, before I commit this as done I'd like to find out one thing from
> > the list and John: How would I get errors from workitem processing in
> > daemon-kit to be stored in the engine's list of errors ?
>
> > I took a stab at it [1] but it falls short, and digging through ruote's code
> > left me a bit lost (probably just too tired). I'd love to be able to just
> > replay errors and have messages dispatched to the daemons again, it is a
> > feature of ruote I've never leveraged before.
>
> > [1] -
> >http://github.com/kennethkalmer/daemon-kit/commit/bc3401136ad01d005f7...
>
> I'd say the local part (as opposed to the remote part) of your participant
> should receive the workitem back and raise an error.
>
> I've been trying to gather an example at :
>
> http://github.com/jmettraux/ruote-beanstalk/blob/ruote2.1/lib/ruote/b...
> http://github.com/jmettraux/ruote-beanstalk/blob/ruote2.1/lib/ruote/b...
>
> but I still have to implement/provide the #raise_error method so that such
> remote errors can be replayed (via a re-dispatch). Still some work for me in
> ruote itself.
>
> Stay tuned,
>
> --
> John Mettraux -http://jmettraux.wordpress.com
>
> --
> you received this message because you are subscribed to the "ruote users"
> group.
> to post : send email to [email protected]
> to unsubscribe : send email to [email protected]
> more options :http://groups.google.com/group/openwferu-users?hl=en
--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en