<div class="gmail_quote">On Thu, Jan 3, 2013 at 6:08 AM, Martin Sustrik <span dir="ltr"><<a href="mailto:sustrik@250bpm.com" target="_blank">sustrik@250bpm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Murray,<br>
<br>
On 28/12/12 22:24, Murray Williams wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm trying to build some glue between a system that uses a low-level ØMQ<br>
implementation and some Enterprise (J2EE for the moment) frameworks, and<br>
I got excited when I read the blog about the RabbitMQ-ØMQ plugin.<br>
Unfortunately, that plugin seems to depend on the older Erlang-ØMQ<br>
(erlzmq) bindings instead of the newer erlzmq2 bindings, and the older<br>
bindings don't compile against my recent version of Erlang ("Driver<br>
compiled with incorrect version of erl_driver.h") so I'm stuck, unless I<br>
want to downgrade my system's Erlang version, but even if I did that,<br>
this would give me a very brittle solution.<br>
</blockquote>
<br>
Here's Martin Sustrik, one of the original authors or RMQ/0MQ plug-in.<br>
<br>
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.<span class="HOEnZb"><font color="#888888"><br>
<br>
Martin<br>
</font></span></blockquote></div><br><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Ah hello! Excellent!</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">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 <i>Erlang and OTP in Action!</i> 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".)</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
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.)</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
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.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
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.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Thanks,</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Murray</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">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? </div>
</div>