renovating Hartog's ping pong example

24 views
Skip to first unread message

John Mettraux

unread,
May 26, 2011, 8:40:48 AM5/26/11
to ruote

Hello List,

do you remember Hartog's ping pong blog post ?

http://simplic.it/blog/an-investigiation-into-ruote-and-amqp

The complete example may be found at

https://github.com/coffeeaddict/ruote-amqp-ping-pong

Unfortunately, the example is stuck in 2010.

I went a bit further and tried to renovate it at

https://github.com/jmettraux/ruote-amqp-ping-pong
https://github.com/jmettraux/ruote-amqp-ping-pong/commit/95ec0cffc621552b80cb9b29435695c7a56a5dc6

Hoping to quickly win and submit a pull request. Unfortunately I lost that bet.

The engine says "ping", the "ping" participant catches the message and puts it back on the "ruote_workitems" queue and after that, nada. The engine's receiver doesn't pick it up.

Kenneth, David, Hartog, you guys have more experience with ruote and Amqp, would you know, what's wrong with the example ?


Best regards,

--
John Mettraux - http://jmettraux.wordpress.com

Kenneth Kalmer

unread,
May 26, 2011, 10:36:54 AM5/26/11
to openwfe...@googlegroups.com

Hi John

I'll dive in with you tomorrow morning to get this updated properly. I
have a pull request on daemon-kit that should help fix this as well.

Kind regards

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

John Mettraux

unread,
May 26, 2011, 7:51:31 PM5/26/11
to openwfe...@googlegroups.com

On Thu, May 26, 2011 at 04:36:54PM +0200, Kenneth Kalmer wrote:
>
> I'll dive in with you tomorrow morning to get this updated properly. I
> have a pull request on daemon-kit that should help fix this as well.

Hello Kenneth,

great !

Not an immediate concern, but I was wondering if you were using the 0.7.0 Amqp gem. I tried the 0.7.1 and it broke too many things. The Ruby-Amqp have been gently lobbying 0.8.0 (they are at rc5 it seems). Were you thinking about upgrading to 0.8.0 sooner or later when it goes out of rc ?

Cheers,

Kenneth Kalmer

unread,
May 27, 2011, 2:01:00 AM5/27/11
to openwfe...@googlegroups.com
On Fri, May 27, 2011 at 1:51 AM, John Mettraux <jmet...@openwfe.org> wrote:
>
> On Thu, May 26, 2011 at 04:36:54PM +0200, Kenneth Kalmer wrote:
>>
>> I'll dive in with you tomorrow morning to get this updated properly. I
>> have a pull request on daemon-kit that should help fix this as well.
>
> Not an immediate concern, but I was wondering if you were using the 0.7.0 Amqp gem. I tried the 0.7.1 and it broke too many things. The Ruby-Amqp have been gently lobbying 0.8.0 (they are at rc5 it seems). Were you thinking about upgrading to 0.8.0 sooner or later when it goes out of rc ?

Hi John

I'll have to layer it up and see. I just looked at a current
ruote-amqp 2.2.x project and I'm using amqp 0.7.0 with ruote-amqp, and
amqp 0.6.7 in the remote participant and it works. I'll have a coffee
while I think this through, maybe I can bump ruote-amqp and daemon-kit
to use 0.8.0.

I'll use the ping-pong example to test this, if it works well we just
need to coordinate the version bump of ruote-amqp with David. I'll
ping the daemon-kit list and the new contributors over there about the
0.8 rc as well.

Ciao !

John Mettraux

unread,
May 27, 2011, 4:20:08 AM5/27/11
to openwfe...@googlegroups.com

On Fri, May 27, 2011 at 08:01:00AM +0200, Kenneth Kalmer wrote:
>
> I'll have to layer it up and see. I just looked at a current
> ruote-amqp 2.2.x project and I'm using amqp 0.7.0 with ruote-amqp, and
> amqp 0.6.7 in the remote participant and it works. I'll have a coffee
> while I think this through, maybe I can bump ruote-amqp and daemon-kit
> to use 0.8.0.
>
> I'll use the ping-pong example to test this, if it works well we just
> need to coordinate the version bump of ruote-amqp with David. I'll
> ping the daemon-kit list and the new contributors over there about the
> 0.8 rc as well.

Hello,

yesterday I tried to move ruote-amqp to Amqp 0.7.1 but it was generally broken, 0.7.1 being too close to 0.8.0.

Hartog told me Amqp 0.8.x was an excellent thing. They're reorganizing their stuff "the right way".

Then I had this exchange on Twitter

https://twitter.com/#!/rubyamqp/status/73727111336181761
https://twitter.com/#!/rubyamqp/status/73727700958846976
https://twitter.com/#!/rubyamqp/status/73728089217187840
https://twitter.com/#!/rubyamqp/status/73728660263276546
https://twitter.com/#!/rubyamqp/status/73729186728120320

Shouldn't be too much work to go 0.8, but since you have quite a consequent infra on 0.7.0, better to have you on the board.

Hartog C. de Mik

unread,
May 27, 2011, 8:45:46 AM5/27/11
to openwfe...@googlegroups.com

Took a lil' trip down memory lane.

The first questions that pop in to my mind are:
- what do the logs of the ping and pong daemon say
- what does `rabbitmqctl list_queues` say? (Perhaps you're listening
on the wrong queue)

Grtz,
Hartog.

John Mettraux

unread,
May 27, 2011, 9:14:06 AM5/27/11
to openwfe...@googlegroups.com

On Fri, May 27, 2011 at 12:45:46PM +0000, Hartog C. de Mik wrote:
>
> The first questions that pop in to my mind are:
> - what do the logs of the ping and pong daemon say
> - what does `rabbitmqctl list_queues` say? (Perhaps you're listening
> on the wrong queue)

Hello Hartog,

https://gist.github.com/raw/995206/f70a815f777578e393b85b61dc3bdd332d3904b3/ping.log
https://gist.github.com/raw/995210/ffa1054f3be6308735812b5a1696699e77dbfdf1/pong.log

and

---8<---
jmettraux@sanma ~/w/ruote-amqp-ping-pong/pong (master) 円 rabbitmqctl list_queues
Listing queues ...
...done.
--->8---


Thanks,

Kit Plummer

unread,
May 27, 2011, 10:50:24 AM5/27/11
to openwfe...@googlegroups.com
Here's what I see for queues:

➜ ~ rabbitmqctl list_queues
Listing queues ...
work1 0
...done.

A bit weird. No pong, no ping, no ruote_workitems. But, perhaps I'm expecting something that isn't supposed to be.

ping work does get to the Ping worker:

[daemon-kit]: DaemonKit (0.1.8.1) 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.8.1) booted, now running ping
[daemon-kit]: AMQP.start({:vhost=>"ruote", :pass=>"ruote", :user=>"ruote", :host=>"localhost"})
[daemon-kit]: Subscribing to ping for workitems
[daemon-kit]: Received workitem: "{\"participant_name\":\"ping\",\"fields\":{\"count\":0,\"dispatched_at\":\"2011-05-27 14:45:31.516024 UTC\",\"__result__\":0,\"params\":{\"participant_options\":{\"forget\":false,\"queue\":\"ping\"},\"command\":\"/ping/ping\",\"reply_queue\":\"ruote_workitems\",\"ref\":\"ping\"},\"state\":\"alpha\"},\"fei\":{\"wfid\":\"20110527-bezarabuda\",\"engine_id\":\"engine\",\"expid\":\"0_1_0\",\"subid\":\"1e4efeabf54867e9b85f3c3db9a52cc2\"}}"
Processing!!!
[daemon-kit]: Replying to engine via AMQP with #<DaemonKit::RuoteWorkitem:0x1015869f0 @workitem={"participant_name"=>"ping", "fields"=>{"count"=>1, "success"=>true, "__result__"=>0, "dispatched_at"=>"2011-05-27 14:45:31.516024 UTC", "params"=>{"participant_options"=>{"forget"=>false, "queue"=>"ping"}, "command"=>"/ping/ping", "ref"=>"ping", "reply_queue"=>"ruote_workitems"}, "state"=>"ping"}, "fei"=>{"wfid"=>"20110527-bezarabuda", "engine_id"=>"engine", "expid"=>"0_1_0", "subid"=>"1e4efeabf54867e9b85f3c3db9a52cc2"}}>
[daemon-kit]: Processed workitem.

But, that's where it stops. So, I guess I can second John's findings.

Kit
--
Kit Plummer :: MaestroDev :: 520.360.4729

> --
> you received this message because you are subscribed to the "ruote users" group.
> to post : send email to openwfe...@googlegroups.com (mailto:openwfe...@googlegroups.com)
> to unsubscribe : send email to openwferu-use...@googlegroups.com (mailto:openwferu-use...@googlegroups.com)
> more options : http://groups.google.com/group/openwferu-users?hl=en


Kenneth Kalmer

unread,
May 28, 2011, 3:34:38 PM5/28/11
to openwfe...@googlegroups.com
On Fri, May 27, 2011 at 10:20 AM, John Mettraux <jmet...@openwfe.org> wrote:
>
> On Fri, May 27, 2011 at 08:01:00AM +0200, Kenneth Kalmer wrote:
>>
>> I'll have to layer it up and see. I just looked at a current
>> ruote-amqp 2.2.x project and I'm using amqp 0.7.0 with ruote-amqp, and
>> amqp 0.6.7 in the remote participant and it works. I'll have a coffee
>> while I think this through, maybe I can bump ruote-amqp and daemon-kit
>> to use 0.8.0.
>>
>> I'll use the ping-pong example to test this, if it works well we just
>> need to coordinate the version bump of ruote-amqp with David. I'll
>> ping the daemon-kit list and the new contributors over there about the
>> 0.8 rc as well.
>
> Hello,
>
> yesterday I tried to move ruote-amqp to Amqp 0.7.1 but it was generally broken, 0.7.1 being too close to 0.8.0.
>
> Hartog told me Amqp 0.8.x was an excellent thing. They're reorganizing their stuff "the right way".

OK, so I nailed it!

I had to make some changes to daemon-kit which requires a new release
and a version bump to 0.1.9 due to the change in the internals... I'll
wrap that up separately, but here is instructions for how to get the
ping pong to work again:

$ git clone git://github.com/kennethkalmer/daemon-kit.git
$ cd daemon-kit
$ rake build
$ gem install pkg/daemon-kit-0.1.8.2.gem
$ gem install amqp -v 0.7.1

Then setup the ping-pong

$ git clone git://github.com/kennethkalmer/ruote-amqp-ping-pong.git
$ cd ruote-amqp-ping-pong
$ cd ping && bundle install
$ cd ../pong && bundle install
$ cd ../ping-pong-engine && bundle install

Then make sure you have different terminals open and proceed:

(1) $ cd ping && ./bin/ping
(2) $ cd pong && ./bin/pong
(3) $ cd pong-pong-engine && ruby lib/main.rb

As an aside, make sure your rabbitmq is configured correctly. If using
brew, simple as this, if not maybe you need sudo:

$ rabbitmqctl add_user ruote ruote
$ rabbitmqctl add_vhost ruote
$ rabbitmqctl set_permissions -p ruote ruote '.*' '.*' '.*'

Feedback appreciated!

Kind regards

Kit Plummer

unread,
May 28, 2011, 4:24:59 PM5/28/11
to openwfe...@googlegroups.com
Thanks Kenneth. Verified 'tis working now. One quick diff noted below:

--
Kit Plummer :: MaestroDev :: 520.360.4729


On Saturday, May 28, 2011 at 12:34 PM, Kenneth Kalmer wrote:

> On Fri, May 27, 2011 at 10:20 AM, John Mettraux <jmet...@openwfe.org (mailto:jmet...@openwfe.org)> wrote:
> >
> > On Fri, May 27, 2011 at 08:01:00AM +0200, Kenneth Kalmer wrote:
> > >
> > > I'll have to layer it up and see. I just looked at a current
> > > ruote-amqp 2.2.x project and I'm using amqp 0.7.0 with ruote-amqp, and
> > > amqp 0.6.7 in the remote participant and it works. I'll have a coffee
> > > while I think this through, maybe I can bump ruote-amqp and daemon-kit
> > > to use 0.8.0.
> > >
> > > I'll use the ping-pong example to test this, if it works well we just
> > > need to coordinate the version bump of ruote-amqp with David. I'll
> > > ping the daemon-kit list and the new contributors over there about the
> > > 0.8 rc as well.
> >
> > Hello,
> >
> > yesterday I tried to move ruote-amqp to Amqp 0.7.1 but it was generally broken, 0.7.1 being too close to 0.8.0.
> >
> > Hartog told me Amqp 0.8.x was an excellent thing. They're reorganizing their stuff "the right way".
>
> OK, so I nailed it!
>
> I had to make some changes to daemon-kit which requires a new release
> and a version bump to 0.1.9 due to the change in the internals... I'll
> wrap that up separately, but here is instructions for how to get the
> ping pong to work again:
>

> $ git clone git://github.com/kennethkalmer/daemon-kit.git (http://github.com/kennethkalmer/daemon-kit.git)


> $ cd daemon-kit
> $ rake build
> $ gem install pkg/daemon-kit-0.1.8.2.gem
> $ gem install amqp -v 0.7.1
>
> Then setup the ping-pong
>

> $ git clone git://github.com/kennethkalmer/ruote-amqp-ping-pong.git (http://github.com/kennethkalmer/ruote-amqp-ping-pong.git)


> $ cd ruote-amqp-ping-pong
> $ cd ping && bundle install

I had to update the Gemfile.lock:

$ cd ping && bundle update

> $ cd ../pong && bundle install

$ cd ../pong && bundle update

> $ cd ../ping-pong-engine && bundle install
>
> Then make sure you have different terminals open and proceed:
>
> (1) $ cd ping && ./bin/ping
> (2) $ cd pong && ./bin/pong
> (3) $ cd pong-pong-engine && ruby lib/main.rb
>
> As an aside, make sure your rabbitmq is configured correctly. If using
> brew, simple as this, if not maybe you need sudo:
>
> $ rabbitmqctl add_user ruote ruote
> $ rabbitmqctl add_vhost ruote
> $ rabbitmqctl set_permissions -p ruote ruote '.*' '.*' '.*'
>
> Feedback appreciated!
>
> Kind regards
>
> --
> Kenneth Kalmer

> kenneth...@gmail.com (mailto:kenneth...@gmail.com)
> http://opensourcery.co.za
> @kennethkalmer

John Mettraux

unread,
May 28, 2011, 10:09:51 PM5/28/11
to openwfe...@googlegroups.com

On Sat, May 28, 2011 at 01:24:59PM -0700, Kit Plummer wrote:
>
> Thanks Kenneth. Verified 'tis working now. One quick diff noted below:

Great news !

I've merged your work Kenneth and submitted a pull request to Hartog :

https://github.com/coffeeaddict/ruote-amqp-ping-pong/pull/1

Have a nice sunday,

Kenneth Kalmer

unread,
May 29, 2011, 8:57:49 AM5/29/11
to openwfe...@googlegroups.com
On Sun, May 29, 2011 at 4:09 AM, John Mettraux <jmet...@openwfe.org> wrote:
>
> On Sat, May 28, 2011 at 01:24:59PM -0700, Kit Plummer wrote:
>>
>> Thanks Kenneth. Verified 'tis working now. One quick diff noted below:
>
> Great news !
>
> I've merged your work Kenneth and submitted a pull request to Hartog :
>
>  https://github.com/coffeeaddict/ruote-amqp-ping-pong/pull/1
>
> Have a nice sunday,

Hi everyone, just to wrap this up, I tested the daemon-kit side with
0.8.0.rc12 as well and it worked without any issues. So from a
daemon-kit perspective, the 3 lines of AMQP code in the project is
compatible with 0.7.1 and 0.8.0.rc12 so I'll note that in a daemon-kit
release.

Thanks to Kit for mentioning the Gemfile.lock glitch, I typed the
instructions off memory before jumping in bed.

Kind regards

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

Hartog C. de Mik

unread,
May 30, 2011, 3:08:58 AM5/30/11
to openwfe...@googlegroups.com
On Sun, May 29, 2011 at 11:09:51AM +0900, John Mettraux wrote:
>
> On Sat, May 28, 2011 at 01:24:59PM -0700, Kit Plummer wrote:
> >
> > Thanks Kenneth. Verified 'tis working now. One quick diff noted below:
>
> Great news !
>
> I've merged your work Kenneth and submitted a pull request to Hartog :
>
> https://github.com/coffeeaddict/ruote-amqp-ping-pong/pull/1

Pulled - I flushed some time in debugging friday but didn't get around
to making the fixes in deamon-kit Kenneth has.

I shall put a note up on my blog that the prerequisites have changed.

/me chdirs to blog and fiddles a bit

Done. Now all we need to do is keep it working ;-)

( Also fixed the short-url on simplic.it to be working again:
http://simplic.it/5a19b5b
)

Grtz,
Hartog.

Reply all
Reply to author
Forward
0 new messages