Excellent, that did the trick! Now I just have to figure out how to
get ruote-amqp to grab the item from the ruote_workitems queue; it's
just sitting there at the moment:

-----
$ amqp-peek ruote_workitems
(ruote_workitems)
  Header:
    :message_count => 1
    :delivery_mode => 1
    :delivery_tag => 1
    :routing_key => "ruote_workitems"
    :redelivered => false
    :content_type => "application/octet-stream"
    :exchange => ""
    :priority => 0
  Message: "{\"participant_name\":\"amqp\",\"fields\":{\"success
\":true,\"dispatched_at\":\"2010-05-01 02:01:59.969869 UTC\",\"quote\":
\"Ecclesiastes 10:8-9\\n8. Whoever digs a pit may fall into it;
whoever breaks through a wall may be \\nbitten by a snake.\\n9.
Whoever quarries stones may be injured by them; whoever splits logs
may be \\nendangered by them.\\n\\n[bible]
http://iheartquotes.com/fortune/show/11913\\n\",\"params\":{\"command\":\"/sample/quote\",\"ref\":\"amqp\",\"queue\":\"work1\",\"reply_queue\":\"ruote_workitems\"}},\"fei\":{\"sub_wfid\":null,\"wfid\":\"20100501-bopehiyade\",\"engine_id\":\"engine\",\"expid\":\"0_0_0\"}}";
-----

I'll plat with it some more, I suspect it's just my ignorance of how
ruote-amqp is intended to be used. I'll post again if I figure it out.

Thanks again for the quick response!

-----
$ bin/ruote
[daemon-kit]: DaemonKit (0.1.8pre) 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.8pre) booted, now running ruote
[daemon-kit]:
AMQP.start({:pass=>"guest", :host=>"localhost", :user=>"guest", :vhost=>"/"})
[daemon-kit]: Subscribing to work1 for workitems
[daemon-kit]: Received workitem: "{\"participant_name\":\"amqp\",
\"fields\":{\"dispatched_at\":\"2010-05-01 02:01:59.969869 UTC\",
\"params\":{\"command\":\"/sample/quote\",\"reply_queue\":
\"ruote_workitems\",\"queue\":\"work1\",\"ref\":\"amqp\"}},\"fei\":
{\"sub_wfid\":null,\"wfid\":\"20100501-bopehiyade\",\"engine_id\":
\"engine\",\"expid\":\"0_0_0\"}}"
[daemon-kit]: Replying to engine via AMQP with
#<DaemonKit::RuoteWorkitem:0x101505a30
@workitem={"participant_name"=>"amqp", "fields"=>{"success"=>true,
"dispatched_at"=>"2010-05-01 02:01:59.969869 UTC",
"quote"=>"Ecclesiastes 10:8-9\n8. Whoever digs a pit may fall into it;
whoever breaks through a wall may be \nbitten by a snake.\n9. Whoever
quarries stones may be injured by them; whoever splits logs may be
\nendangered by them.\n\n[bible] http://iheartquotes.com/fortune/show/11913\n";,
"params"=>{"command"=>"/sample/quote", "ref"=>"amqp",
"queue"=>"work1", "reply_queue"=>"ruote_workitems"}},
"fei"=>{"sub_wfid"=>nil, "wfid"=>"20100501-bopehiyade",
"engine_id"=>"engine", "expid"=>"0_0_0"}}>
[daemon-kit]: Processed workitem.
-----

On Apr 30, 6:52 pm, John Mettraux <[email protected]> wrote:
> On Fri, Apr 30, 2010 at 04:48:26PM -0700, threetee wrote:
>
> > ----------
> > #!/usr/bin/env ruby
>
> > require 'rubygems'
> > require 'ruote-amqp'
> > require 'ruote-amqp/participant'
> > require 'ruote'
> > require 'ruote/storage/fs_storage'
>
> > engine = Ruote::Engine.new(
> >           Ruote::Worker.new(
> >             Ruote::FsStorage.new('ruote_work')
> >           )
> >         )
>
> > AMQP.settings[:host] = 'rabbitmq'
> > # AMQP.settings[:logging] = true
> > puts AMQP.settings.inspect
>
> > engine.register_participant(:amqp,
> > RuoteAMQP::Participant.new(:reply_by_default => true )) do |workitem|
> >   puts workitem.inspect
> > end
>
> > pdef = Ruote.process_definition :name => 'print_quote' do
> >   sequence do
> >     amqp :queue => 'work1', :command => '/sample/quote'
> >   end
> > end
>
> > wfid = engine.launch(pdef)
>
> > engine.wait_for(wfid)
> > ----------
>
> Hello ThreeTee,
>
> at first a quick disclaimer, I'm ruote's main author, but I haven't much 
> experience with ruote-amqp.
>
> RuoteAMQP::Participant, as of ruote-amqp 2.1.5, isn't supposed to accept 
> blocks, it's fun that it works and displays the workitem.
>
> If I understood correctly your ruby example isn't emitting anything to the 
> AMQP queue, is that right ?
>
> How does
>
> ---8<---
>   engine.register_participant(:amqp, RuoteAMQP::Participant, 
> :reply_by_default => true)
> --->8---
>
> work though ?
>
> Ruote 2.1 prefers participants registered this way.
>
> Cheers,
>
> --
> 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

Reply via email to