Updated daemon-kit-engine.rb example code?

28 views
Skip to first unread message

threetee

unread,
May 1, 2010, 12:53:46 AM5/1/10
to Daemon Kit
I've been working on getting ruote and ruote-amqp to use the daemon-
kit amqp template as a remote participant. The amqp template refers to
http://gist.github.com/144861 for a sample engine, but that example
code is pretty outdated and definitely doesn't work with Ruote 2.1.
Does anyone know of an updated version of the sample engine that is
available for reference, or some other example code for how to
integrate modern ruote/ruote-amqp versions with daemon-kit?

Thanks in advance for any information!

--
You received this message because you are subscribed to the Google Groups "Daemon Kit" group.
To post to this group, send email to daemo...@googlegroups.com.
To unsubscribe from this group, send email to daemon-kit+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/daemon-kit?hl=en.

Kenneth Kalmer

unread,
May 2, 2010, 5:26:43 PM5/2/10
to daemo...@googlegroups.com
On Sat, May 1, 2010 at 6:53 AM, threetee <thre...@gmail.com> wrote:
I've been working on getting ruote and ruote-amqp to use the daemon-
kit amqp template as a remote participant. The amqp template refers to
http://gist.github.com/144861 for a sample engine, but that example
code is pretty outdated and definitely doesn't work with Ruote 2.1.
Does anyone know of an updated version of the sample engine that is
available for reference, or some other example code for how to
integrate modern ruote/ruote-amqp versions with daemon-kit?

Thanks in advance for any information!

Hi there

Thanks for bringing this under my attention ! I'll clean up the ruote-amqp integration in the coming days and update the examples as needed. I'm busy setting up a fresh testing environment for my AMQP work so I can fix this as well as test the issues you reported on the ruote group.

Best 


--
Kenneth Kalmer
kenneth...@gmail.com
http://opensourcery.co.za
@kennethkalmer

threetee

unread,
May 3, 2010, 8:57:44 PM5/3/10
to Daemon Kit
Thanks Kenneth!

I'll also share my efforts so far. Some background info:

- The code below successfully passes the workitem to the daemon-kit
AMQP agent, but Ruote is having trouble processing the response back
from the agent. More at http://groups.google.com/group/openwferu-users/browse_thread/thread/fa353d06f3fec736
if you're interested.

- Gem versions:
ruote (2.1.10)
ruote-amqp (2.1.5)
ruote-kit (2.1.7)
daemon-kit (0.1.8pre) - I used daustin's daemon-kit fork (http://
github.com/daustin/daemon-kit)

----------
#!/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'

puts AMQP.settings.inspect

engine = Ruote::Engine.new(
Ruote::Worker.new(
Ruote::HashStorage.new()
)
)

listener = RuoteAMQP::WorkitemListener.new(engine)

pdef = Ruote.process_definition :name => 'print_quote' do
sequence do
amqp :queue => 'work1', :command => '/sample/quote'
end
end

engine.register_participant(:amqp, RuoteAMQP::Participant)

fei = engine.launch(pdef)

engine.wait_for(fei)
----------

Hope this is helpful for someone else who is also struggling with
Ruote/AMQP/daemon-kit like I am. :) I would welcome any tips or
pointers you all may have.

On May 2, 2:26 pm, Kenneth Kalmer <kenneth.kal...@gmail.com> wrote:
> On Sat, May 1, 2010 at 6:53 AM, threetee <three...@gmail.com> wrote:
> > I've been working on getting ruote and ruote-amqp to use the daemon-
> > kit amqp template as a remote participant. The amqp template refers to
> >http://gist.github.com/144861for a sample engine, but that example
> > code is pretty outdated and definitely doesn't work with Ruote 2.1.
> > Does anyone know of an updated version of the sample engine that is
> > available for reference, or some other example code for how to
> > integrate modern ruote/ruote-amqp versions with daemon-kit?
>
> > Thanks in advance for any information!
>
> Hi there
>
> Thanks for bringing this under my attention ! I'll clean up the ruote-amqp
> integration in the coming days and update the examples as needed. I'm busy
> setting up a fresh testing environment for my AMQP work so I can fix this as
> well as test the issues you reported on the ruote group.
>
> Best
>
> --
> Kenneth Kalmer
> kenneth.kal...@gmail.comhttp://opensourcery.co.za

threetee

unread,
May 10, 2010, 1:45:23 PM5/10/10
to Daemon Kit
To close the loop on this topic: thanks to Kenneth and John, I was
able to work through my ruote/ruote-amqp problems and get my example
code working. I've merged the standalone test script I was working on
into an example Rails app, which is available at
http://github.com/threetee/ruote-rails-example.

On May 3, 5:57 pm, threetee <three...@gmail.com> wrote:
> Thanks Kenneth!
>
> I'll also share my efforts so far. Some background info:
>
> - The code below successfully passes the workitem to the daemon-kit
> AMQP agent, but Ruote is having trouble processing the response back
> from the agent. More athttp://groups.google.com/group/openwferu-users/browse_thread/thread/f...
> > >http://gist.github.com/144861fora sample engine, but that example
Reply all
Reply to author
Forward
0 new messages