[rabbitmq-discuss] Any movement on RabbitMQ-ØMQ?
Murray Williams
murraytodd at gmail.com
Thu Jan 3 15:50:45 GMT 2013
On Thu, Jan 3, 2013 at 6:08 AM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> Hi Murray,
>
> On 28/12/12 22:24, Murray Williams wrote:
>
>> I'm trying to build some glue between a system that uses a low-level ØMQ
>> implementation and some Enterprise (J2EE for the moment) frameworks, and
>> I got excited when I read the blog about the RabbitMQ-ØMQ plugin.
>> Unfortunately, that plugin seems to depend on the older Erlang-ØMQ
>> (erlzmq) bindings instead of the newer erlzmq2 bindings, and the older
>> bindings don't compile against my recent version of Erlang ("Driver
>> compiled with incorrect version of erl_driver.h") so I'm stuck, unless I
>> want to downgrade my system's Erlang version, but even if I did that,
>> this would give me a very brittle solution.
>>
>
> Here's Martin Sustrik, one of the original authors or RMQ/0MQ plug-in.
>
> I don't have time to look into the plugin at the moment, however, if you
> have any specific questions about it feel free to ask.
>
> Martin
>
Ah hello! Excellent!
In fact, I've been working pretty hard at seeing if I could bring that code
up to date. (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. I created each module from scratch and copied your original functions
one-by-one so I could examine them and catch-and-change the older zmq:
calls and update them to the newer Erlzmq2 APIs. (That's not very hard. The
biggest change is that you have to create a "context" and pass it to the
calls that create ØMQ sockets. Also, "upstream" and "downstream" names were
changed to "push" and "pull".)
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. 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. (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.
Does any of the above make sense? If you have any pieces of advice, I'd
love to hear any pointers. Also, I'll get everything I've done up on my
github fork soon.
Thanks,
Murray
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. Is that suggesting that the ipv4 address is in a packed (4-byte)
representation as opposed to being written out in ascii characters?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130103/5d2a4856/attachment.htm>
More information about the rabbitmq-discuss
mailing list