Yes - that works!<br><br>Suggestion: Add the trivial plugin to the standard build so that<br>it stays up to date with coding changes. Developers love examples<br>that work, which has been one of the reasons for Rabbit's success.<br clear="all">
<br>Jerry - Thank you very much,<br><br>- Jim<br><br>Jim Irrer <a href="mailto:irrer@umich.edu">irrer@umich.edu</a> (734) 647-4409<br>University of Michigan Hospital Radiation Oncology<br>519 W. William St. Ann Arbor, MI 48103<br>
<br><br><div class="gmail_quote">On Fri, Mar 18, 2011 at 5:02 PM, Jerry Kuch <span dir="ltr"><<a href="mailto:jerryk@vmware.com">jerryk@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi, Jim.<br>
<br>
Attached is a gzipped tar file containing rabbitmq-empty-plugin, a close to absolutely bare bones plugin I made by stripping down one of my projects.<br>
<br>
If you uncompress it under your checkout of rabbitmq-public-umbrella, you should be able to just go into that directory and type 'make'.<br>
<br>
Then go over to your rabbitmq-server directory, which should be a sibling of the directory where the uncompressed empty plugin lives under your public-umbrella. In the plugins subdirectory of rabbitmq-server create a symbolic link:<br>
<br>
ln -s ../../rabbitmq-empty-plugin rabbitmq-empty-plugin<br>
<br>
Now 'make run' to start up your broker.<br>
<br>
If all goes well you'll see "rabbit_empty_plugin-0.1.0" appear in the "plugins activated" section of the broker's start-up preamble.<br>
<br>
Once the Erlang REPL prompt appears again you can try:<br>
<br>
appmon:start().<br>
<br>
Explore the app tree that appears and you should see rabbit_empty_plugin present as a child of your rabbit process. If you double click on the rabbit_empty_plugin node you'll see the supervision tree for the empty plugin.<br>
<br>
Note that at the moment it really does nothing except start up. The rabbit_empty_plugin is an instance of the Erlang 'application' behaviour, and it starts an OTP supervisor called 'rabbit_empty_sup' which lords over an Erlang process called 'rabbit_empty_worker', enforcing the restart policy indicated in the code with an iron, OTP-ish fist.<br>
<br>
By grepping around for where the word "empty" appears in the .erl and .app files, and the Makefile, you should be able to mutate this into the basis of your very own Rabbit plugin.<br>
<br>
Good luck. Please let us know if we can help out further.<br>
<br>
Best regards,<br>
Jerry<br>
<br>
P.S. You mentioned that you were new to Erlang. The Manning book below:<br>
<br>
<a href="http://www.manning.com/logan/" target="_blank">http://www.manning.com/logan/</a><br>
<br>
is a good resource, and has better coverage of the OTP libraries and design principles than you'll find in many other places. Armstrong's book is also likely to be helpful to you if you're going to be using Erlang much:<br>
<br>
<a href="http://www.pragprog.com/titles/jaerlang/programming-erlang" target="_blank">http://www.pragprog.com/titles/jaerlang/programming-erlang</a><br>
<br>
________________________________________<br>
From: <a href="mailto:jimirrer@gmail.com">jimirrer@gmail.com</a> [<a href="mailto:jimirrer@gmail.com">jimirrer@gmail.com</a>] On Behalf Of Jim Irrer [<a href="mailto:irrer@umich.edu">irrer@umich.edu</a>]<br>
Sent: Friday, March 18, 2011 12:50 PM<br>
To: Jerry Kuch<br>
Cc: <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<div class="im">Subject: Re: [rabbitmq-discuss] Fwd: Problem with plugin development guide example<br>
<br>
</div><div class="im">Jerry -<br>
<br>
Yes, that would be great. All I'm looking for is a hello world example of<br>
a plugin to get me started.<br>
<br>
Thanks,<br>
<br>
- Jim<br>
<br>
</div><div class="im">Jim Irrer <a href="mailto:irrer@umich.edu">irrer@umich.edu</a><mailto:<a href="mailto:irrer@umich.edu">irrer@umich.edu</a>> <a href="tel:%28734%29%20647-4409">(734) 647-4409</a><br>
</div><div class="im">University of Michigan Hospital Radiation Oncology<br>
519 W. William St. Ann Arbor, MI 48103<br>
<br>
<br>
</div><div class="im">On Fri, Mar 18, 2011 at 1:32 PM, Jerry Kuch <<a href="mailto:jerryk@vmware.com">jerryk@vmware.com</a><mailto:<a href="mailto:jerryk@vmware.com">jerryk@vmware.com</a>>> wrote:<br>
Jim:<br>
<br>
I also have a vague recollection that a month or two ago I found a couple out of date spots in the plugin development guide that might cause you grief. I did put together a basic plugin for other reasons, that I could conceivably husk out and share with you as a starting point you might find convenient?<br>
<br>
Best regards,<br>
Jerry<br>
________________________________________<br>
</div>From: <a href="mailto:rabbitmq-discuss-bounces@lists.rabbitmq.com">rabbitmq-discuss-bounces@lists.rabbitmq.com</a><mailto:<a href="mailto:rabbitmq-discuss-bounces@lists.rabbitmq.com">rabbitmq-discuss-bounces@lists.rabbitmq.com</a>> [<a href="mailto:rabbitmq-discuss-bounces@lists.rabbitmq.com">rabbitmq-discuss-bounces@lists.rabbitmq.com</a><mailto:<a href="mailto:rabbitmq-discuss-bounces@lists.rabbitmq.com">rabbitmq-discuss-bounces@lists.rabbitmq.com</a>>] On Behalf Of Jim Irrer [<a href="mailto:irrer@umich.edu">irrer@umich.edu</a><mailto:<a href="mailto:irrer@umich.edu">irrer@umich.edu</a>>]<br>
<div class="im">Sent: Friday, March 18, 2011 9:22 AM<br>
</div>To: <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><mailto:<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a>><br>
<div><div></div><div class="h5">Cc: Jim Irrer<br>
Subject: Re: [rabbitmq-discuss] Fwd: Problem with plugin development guide example<br>
<br>
That was helpful - I got farther - but not there yet.<br>
<br>
I did the checkout of the umbrella with the command above:<br>
<br>
hg clone <a href="http://hg.rabbitmq.com/rabbitmq-public-umbrella" target="_blank">http://hg.rabbitmq.com/rabbitmq-public-umbrella</a> -r bug23568<br>
<br>
but I did the 'make co' without any special parameters, so I assumed<br>
that it did hg commands with respect to the bug23568 branch.<br>
<br>
I built the metronome project as outlined on the Rabbit site and added<br>
the rabbit_metronome-0.0.0.ez and amqp_client.ez files to the<br>
rabbitmq-public-umbrella/rabbitmq-server/plugins directory, but when I<br>
start it up I get:<br>
<br>
linus:make run<br>
RABBITMQ_NODE_IP_ADDRESS="" RABBITMQ_NODE_PORT="5679" RABBITMQ_LOG_BASE="/tmp" RABBITMQ_MNESIA_DIR="/tmp/rabbitmq-bunny-mnesia" RABBITMQ_PLUGINS_EXPAND_DIR="/tmp/rabbitmq-bunny-plugins-scratch" \<br>
RABBITMQ_ALLOW_INPUT=true \<br>
RABBITMQ_SERVER_START_ARGS="" \<br>
./scripts/rabbitmq-server<br>
Activating RabbitMQ plugins ...<br>
*WARNING* Undefined function amqp_connection:start_direct/0<br>
*WARNING* Undefined function gb_trees:map/2<br>
*WARNING* Undefined function os:timestamp/0<br>
*WARNING* Undefined function random:seed/1<br>
*WARNING* Undefined function ssl:ssl_accept/3<br>
2 plugins activated:<br>
* amqp_client-0.0.0<br>
* rabbit_metronome-0.0.0<br>
<br>
Erlang (BEAM) emulator version 5.6.5 [source] [64-bit] [smp:2] [async-threads:30] [hipe] [kernel-poll:true]<br>
<br>
<br>
+---+ +---+<br>
| | | |<br>
| | | |<br>
| | | |<br>
| +---+ +-------+<br>
| |<br>
| RabbitMQ +---+ |<br>
| | | |<br>
| v%%VSN%% +---+ |<br>
| |<br>
+-------------------+<br>
AMQP 0-9-1 / 0-9 / 0-8<br>
Copyright (C) 2007-2011 VMware, Inc.<br>
Licensed under the MPL. See <a href="http://www.rabbitmq.com/" target="_blank">http://www.rabbitmq.com/</a><br>
<br>
node : bunny@linus<br>
app descriptor : /devel/home/irrer/tmp/erl/r2/rabbitmq-public-umbrella/rabbitmq-server/scripts/../ebin/rabbit.app<br>
home dir : /home/irrer<br>
config file(s) : (none)<br>
cookie hash : JG6HnrDO2nMIVTU2s7iwoA==<br>
log : /tmp/bunny.log<br>
sasl log : /tmp/bunny-sasl.log<br>
database dir : /tmp/rabbitmq-bunny-mnesia<br>
erlang version : 5.6.5<br>
<br>
starting file handle cache server ...done<br>
starting worker pool ...done<br>
starting database ...done<br>
starting codec correctness check ...done<br>
-- external infrastructure ready<br>
starting statistics event manager ...done<br>
starting logging server ...done<br>
starting plugin registry ...done<br>
starting auth mechanism amqplain ...done<br>
starting auth mechanism cr-demo ...done<br>
starting auth mechanism plain ...done<br>
starting exchange type direct ...done<br>
starting exchange type fanout ...done<br>
starting exchange type headers ...done<br>
starting exchange type topic ...done<br>
-- kernel ready<br>
starting node monitor ...done<br>
starting cluster delegate ...done<br>
starting guid generator ...done<br>
starting alarm handler ...done<br>
starting memory monitor ...done<br>
-- core initialized<br>
starting empty DB check ...done<br>
starting exchange recovery ...done<br>
starting queue supervisor and queue recovery ...done<br>
-- message delivery logic ready<br>
starting error log relay ...done<br>
starting networking ...done<br>
starting notify cluster nodes ...done<br>
starting direct_client ...done<br>
<br>
broker running<br>
Eshell V5.6.5 (abort with ^G)<br>
(bunny@linus)1> Erlang has closed<br>
{"Kernel pid terminated",application_controller,"{application_start_failure,rabbit_metronome,{shutdown,{rabbit_metronome,start,[normal,[]]}}}"}<br>
<br>
Crash dump was written to: erl_crash.dump<br>
Kernel pid terminated (application_controller) ({application_start_failure,rabbit_metronome,{shutdown,{rabbit_metronome,start,[normal,[]]}}})<br>
<br>
And as advertised it creates a big honkin' dump file.<br>
<br>
I also had to create symbolic links so that the code would build. In my<br>
rabbitmq-public-umbrella/rabbit_metronome directory I created:<br>
<br>
amqp_client -> ../rabbitmq-erlang-client/dist/amqp_client<br>
rabbit_common -> ../rabbitmq-erlang-client/dist/rabbit_common<br>
<br>
The server works fine if run without adding plugins, but when I add them<br>
it bombs, so I know the plugins are the problem (Right?).<br>
<br>
I'm new to Erlang (interesting language), so all I did was cut and paste<br>
the example Erlang code, so if that code is out of date then it would be a problem.<br>
<br>
Also: I changed the port to 5679 so it would not interfere with the official<br>
installed RabbitMQ server on the same machine, and I set RABBITMQ_NODENAME<br>
to 'bunny'.<br>
<br>
Thanks,<br>
<br>
- Jim<br>
<br>
</div></div>Jim Irrer <a href="mailto:irrer@umich.edu">irrer@umich.edu</a><mailto:<a href="mailto:irrer@umich.edu">irrer@umich.edu</a>><mailto:<a href="mailto:irrer@umich.edu">irrer@umich.edu</a><mailto:<a href="mailto:irrer@umich.edu">irrer@umich.edu</a>>> <a href="tel:%28734%29%20647-4409">(734) 647-4409</a><tel:%28734%29%20647-4409><tel:%28734%29%20647-4409><br>
<div class="im">University of Michigan Hospital Radiation Oncology<br>
519 W. William St. Ann Arbor, MI 48103<br>
<br>
<br>
</div><div class="im">On Thu, Mar 17, 2011 at 8:27 AM, Matthew Sackman <<a href="mailto:matthew@rabbitmq.com">matthew@rabbitmq.com</a><mailto:<a href="mailto:matthew@rabbitmq.com">matthew@rabbitmq.com</a>><mailto:<a href="mailto:matthew@rabbitmq.com">matthew@rabbitmq.com</a><mailto:<a href="mailto:matthew@rabbitmq.com">matthew@rabbitmq.com</a>>>> wrote:<br>
On Tue, Mar 15, 2011 at 07:00:28PM -0400, Jim Irrer wrote:<br>
> If I checkout the latest server code, will I get the bug23274 fix?<br>
<br>
Nope. bug23274 has been abandoned. bug23568 replaces it, but is yet to<br>
go through QA. None of the documentation regarding writing plugins has<br>
been updated.<br>
<br>
> If not, what is the Mercurial command to get it?<br>
<br>
hg clone <a href="http://hg.rabbitmq.com/rabbitmq-public-umbrella" target="_blank">http://hg.rabbitmq.com/rabbitmq-public-umbrella</a> -r bug23568<br>
<br>
But you'll need to make sure all the plugins are also on branch bug23568<br>
for them to work with the new build system.<br>
<br>
If you're writing plugins from scratch, be sure to read the<br>
rabbitmq-public-umbrella/README.makefiles file, which has a helpful<br>
section on "Creating a new package".<br>
<br>
Matthew<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
</div><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><mailto:<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a>><mailto:<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><mailto:<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a>>><br>
<div><div></div><div class="h5"><a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br>
<br>
</div></div></blockquote></div><br>