On Mon, 2015-12-14 at 11:40 -0700, Philippe Le Rohellec wrote: > Thanks Alan, > > I tried that but a recent change to the SWIG bindings broke the > reactor > interface in ruby. I commented on > https://issues.apache.org/jira/browse/PROTON-949 as you already notic > ed. > Even after it's fixed there are other issues popping up with the > reactor > interface, something with a prototype mismatch of an ssl.rb method > (https://gist.github.com/plerohellec/3a73b71b04aaa22845c3), I couldn' > t find > an easy fix for that. > I also switched to the 0.10.x branch with the same result so I gave > up on > the reactor.
Funny you should say that. I also recently gave up on the reactor in ruby - the last straw was the GVL, which blocks every ruby thread in the process while proton is in blocking select calls. However messenger is also problematic, so I am working on a ConnectionEngine, a kind of mini-reactor. The user API is almost identical to reactor apps (event-based), but the setup is different. Take a look at: https://github.com/BitScoutOrg/docker-fluentd/tree/master/amqp_qpid/lib /fluent/plugin qpid_proton_extra.rb is all stuff I plan to bring into proton when I get a chance to clean it up. The rest is a fluent plugin, which is not relevant, but illustrates the use of ConnectionEngine. The handlers are the same as the reactor handlers but the IO and threading parts are native in Ruby which avoids the GVL problems and fits more neatly into a Ruby application. I haven't tried anything with SSL, if you find a problem there JIRA it. I'm on the hook for ruby now. > I added the missing binding (Messenger#get_link) but I haven't been > able to > get the expected result from passing a filter yet. I will open a PR > if I > manage to get it to work. By the way, this is a modified recv.rb that > sets > the filter: https://gist.github.com/plerohellec/55f3fde1b303f04d259d > I'm not sure the filter are actually used when when receiving a > message, > could you give it a quick review? It looks ok but I hit the get link problem also. I think the code will work though, as I tried a similar example using the reactor and both wireshark and qpidd debug logs confirm that the filter string is passed correctly. I found some other bugs in the ruby binding while doing this so I will fix it all up and put up the example ASAP. Please feel free to raise JIRAs for any and all problems you find, I want to beat the ruby binding into shape and your input helps tremendously.