[rabbitmq-discuss] Any movement on RabbitMQ-ØMQ?

Simon MacMullen simon at rabbitmq.com
Thu Jan 3 16:13:44 GMT 2013

On 03/01/13 15:50, Murray Williams wrote:
> In fact, I've been working pretty hard at seeing if I could bring that
> code up to date.

Cool! I did not touch the 0mq plugin, but here are some half-answers...

  (And, in the process, I'm reading /Erlang and OTP in
> Action!/ so I'm not completely in the dark here.) I started by creating
> a brand new RabbitMQ plugin—using the rabbitmq-metronome as an example,
> since I'm guessing/hoping it follows the most current plugin conventions
> for RabbitmQ 3.x.

Yes it does.

> Everything compiles, and I can install and enable the plugin, but right
> now it looks like the supervisor keeps shutting down for some reason
> that I can't quite figure out yet.

If you point me at the source I might be able to help.

> Part of it is just that I don't quite
> understand the various init and start_link conventions for
> gen_server—that will come in due time. The other thing is that I don't
> know how the configuration information information makes it to the
> supervisor. I thought it was being passed as the arguments in the
> application's start/2 call, but that looks like it's being called with
> an empty list.

That's a generic way to pass arguments to a new process, part of OTP.

> (Maybe that's how things worked with the older versions
> of RabbitMQ? It's hard to know since there isn't much plugin
> documentation out there.)
> Looking at rabbitmq-stomp, I'm guessing that actually entries in the
> rabbit.config are supposed to update/replace elements in the .app.src
> file's {env, []} element, and that I need to write code to extract all
> that stuff from the environment. I was going to tackle playing with that
> today.

...but yes, to read from the config file, use application:get_env/2. 
This hasn't changed in Rabbit versions.

> P.S. Being new to Erlang, I'm completely confused when I look at
> r0mq_sup's full_address(Address) functions. Hopefully it'll just work in
> place, but I would love it if you could just tell me what exactly it's
> trying to validate, especially the part where
> the io_lib:char_list(Address) test fails.

AFAICS that looks like full_address/1 can also take a list of addresses. 
So the io_lib:char_list/1 test is testing whether you have a 
string-implemented-as-list-of-integers, or a list of addresses.

Cheers, Simon

Simon MacMullen
RabbitMQ, VMware

More information about the rabbitmq-discuss mailing list