[rabbitmq-discuss] Fwd: Problem with plugin development guide example

Jerry Kuch jerryk at vmware.com
Fri Mar 18 17:32:47 GMT 2011


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?

Best regards,
From: rabbitmq-discuss-bounces at lists.rabbitmq.com [rabbitmq-discuss-bounces at lists.rabbitmq.com] On Behalf Of Jim Irrer [irrer at umich.edu]
Sent: Friday, March 18, 2011 9:22 AM
To: rabbitmq-discuss at lists.rabbitmq.com
Cc: Jim Irrer
Subject: Re: [rabbitmq-discuss] Fwd: Problem with plugin development guide      example

That was helpful - I got farther - but not there yet.

I did the checkout of the umbrella with the command above:

hg clone http://hg.rabbitmq.com/rabbitmq-public-umbrella -r bug23568

but I did the 'make co' without any special parameters, so I assumed
that it did hg commands with respect to the bug23568 branch.

I built the metronome project as outlined on the Rabbit site and added
the rabbit_metronome-0.0.0.ez and amqp_client.ez files to the
rabbitmq-public-umbrella/rabbitmq-server/plugins directory, but when I
start it up I get:

linus:make run
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" \
                RABBITMQ_ALLOW_INPUT=true \
                RABBITMQ_SERVER_START_ARGS="" \
Activating RabbitMQ plugins ...
*WARNING* Undefined function amqp_connection:start_direct/0
*WARNING* Undefined function gb_trees:map/2
*WARNING* Undefined function os:timestamp/0
*WARNING* Undefined function random:seed/1
*WARNING* Undefined function ssl:ssl_accept/3
2 plugins activated:
* amqp_client-0.0.0
* rabbit_metronome-0.0.0

Erlang (BEAM) emulator version 5.6.5 [source] [64-bit] [smp:2] [async-threads:30] [hipe] [kernel-poll:true]

+---+   +---+
|   |   |   |
|   |   |   |
|   |   |   |
|   +---+   +-------+
|                   |
| RabbitMQ  +---+   |
|           |   |   |
| v%%VSN%%  +---+   |
|                   |
AMQP 0-9-1 / 0-9 / 0-8
Copyright (C) 2007-2011 VMware, Inc.
Licensed under the MPL.  See http://www.rabbitmq.com/

node           : bunny at linus
app descriptor : /devel/home/irrer/tmp/erl/r2/rabbitmq-public-umbrella/rabbitmq-server/scripts/../ebin/rabbit.app
home dir       : /home/irrer
config file(s) : (none)
cookie hash    : JG6HnrDO2nMIVTU2s7iwoA==
log            : /tmp/bunny.log
sasl log       : /tmp/bunny-sasl.log
database dir   : /tmp/rabbitmq-bunny-mnesia
erlang version : 5.6.5

starting file handle cache server                                     ...done
starting worker pool                                                  ...done
starting database                                                     ...done
starting codec correctness check                                      ...done
-- external infrastructure ready
starting statistics event manager                                     ...done
starting logging server                                               ...done
starting plugin registry                                              ...done
starting auth mechanism amqplain                                      ...done
starting auth mechanism cr-demo                                       ...done
starting auth mechanism plain                                         ...done
starting exchange type direct                                         ...done
starting exchange type fanout                                         ...done
starting exchange type headers                                        ...done
starting exchange type topic                                          ...done
-- kernel ready
starting node monitor                                                 ...done
starting cluster delegate                                             ...done
starting guid generator                                               ...done
starting alarm handler                                                ...done
starting memory monitor                                               ...done
-- core initialized
starting empty DB check                                               ...done
starting exchange recovery                                            ...done
starting queue supervisor and queue recovery                          ...done
-- message delivery logic ready
starting error log relay                                              ...done
starting networking                                                   ...done
starting notify cluster nodes                                         ...done
starting direct_client                                                ...done

broker running
Eshell V5.6.5  (abort with ^G)
(bunny at linus)1> Erlang has closed
                                 {"Kernel pid terminated",application_controller,"{application_start_failure,rabbit_metronome,{shutdown,{rabbit_metronome,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,rabbit_metronome,{shutdown,{rabbit_metronome,start,[normal,[]]}}})

And as advertised it creates a big honkin' dump file.

I also had to create symbolic links so that the code would build.  In my
rabbitmq-public-umbrella/rabbit_metronome directory I created:

amqp_client -> ../rabbitmq-erlang-client/dist/amqp_client
rabbit_common -> ../rabbitmq-erlang-client/dist/rabbit_common

The server works fine if run without adding plugins, but when I add them
it bombs, so I know the plugins are the problem (Right?).

I'm new to Erlang (interesting language), so all I did was cut and paste
the example Erlang code, so if that code is out of date then it would be a problem.

Also: I changed the port to 5679 so it would not interfere with the official
installed RabbitMQ server on the same machine, and I set RABBITMQ_NODENAME
to 'bunny'.


- Jim

Jim Irrer     irrer at umich.edu<mailto:irrer at umich.edu>       (734) 647-4409<tel:%28734%29%20647-4409>
University of Michigan Hospital Radiation Oncology
519 W. William St.             Ann Arbor, MI 48103

On Thu, Mar 17, 2011 at 8:27 AM, Matthew Sackman <matthew at rabbitmq.com<mailto:matthew at rabbitmq.com>> wrote:
On Tue, Mar 15, 2011 at 07:00:28PM -0400, Jim Irrer wrote:
> If I checkout the latest server code, will I get the bug23274 fix?

Nope. bug23274 has been abandoned. bug23568 replaces it, but is yet to
go through QA. None of the documentation regarding writing plugins has
been updated.

> If not, what is the Mercurial command to get it?

hg clone http://hg.rabbitmq.com/rabbitmq-public-umbrella -r bug23568

But you'll need to make sure all the plugins are also on branch bug23568
for them to work with the new build system.

If you're writing plugins from scratch, be sure to read the
rabbitmq-public-umbrella/README.makefiles file, which has a helpful
section on "Creating a new package".

rabbitmq-discuss mailing list
rabbitmq-discuss at lists.rabbitmq.com<mailto:rabbitmq-discuss at lists.rabbitmq.com>

More information about the rabbitmq-discuss mailing list