Skip to content
nofxx edited this page Sep 12, 2010 · 3 revisions

Testing RabbitMQ is installed

erl
1> eunit:module_info().
... you should see a bunch of interesting info here
2> rabbit:module_info().
... info here but NOT: ** exception error: undefined function rabbit:module_info/0

Test AMQP

sudo rabbitmq-server -detached
ruby examples/mq/simple-get.rb
[Thu Jan 01 01:08:36 -0500 2009, "Totally rad 1"]
[Thu Jan 01 01:08:36 -0500 2009, "Totally rad 2"]
[Thu Jan 01 01:08:36 -0500 2009, :queue_empty!]
...
ctrl-c
rabbitmqctl stop # yeah you don't need to sudo to stop it, go figure

Test Nanite

sudo rabbitmq-server -detached
cd examples/myagent
nanite &
nanite-mapper -i
Starting IRB console under ::Nanite
>> Nanite.request('/clock/time') {|res| p res }
{"barney"=>Thu Jan 01 01:37:04 -0500 2009}=> "fe900af46ca43168c39a938c5c24348a"
<NOTE: it took me a few times to get a result back, ymmv>
quit
rabbitmqctl stop

Simple Echo

Try this example:

git clone git://github.com/ezmobius/nanite.git
cd nanite/examples

Run rabbitconf.rb to set up rabbimq vhosts and users:

./rabbitconf.rb

Start an agent on the simpleagent folder:

cd simpleagent
nanite-agent --token foo&

Run the cli mapper:

./cli.rb

You should see something like this:

INFO: SEND [advertise] to nanite-foo
INFO: SEND [register] foo, services: /simple/echo, /simple/time, /simple/gems, /simple/yielding, /simple/delayed, tags:
INFO: SEND [request] <7b4a6270c695de38301946c8323b07fa> /simple/echo from mapper to foo
DEBUG: RECV [request] <7b4a6270c695de38301946c8323b07fa> /simple/echo from mapper to foo, reply_to mapper, payload "hello world!"
INFO: SEND [result] <7b4a6270c695de38301946c8323b07fa>

All done, the rest is up to you.