zeromq / chumak

Pure Erlang implementation of ZeroMQ Message Transport Protocol.
Mozilla Public License 2.0
197 stars 47 forks source link

ZMTP 1.0/2.0 Backwards Interoperability #15

Closed tvjg closed 5 years ago

tvjg commented 7 years ago

I'm supporting some applications that still use libzmq 2.2 and I'm wondering if you would be receptive to adding backwards interoperability with earlier versions of the protocol. After a few passes over the specifications and the chumak codebase, it appears this would entail (at the highest level):

chumak_protocol.erl is already approaching 800 lines and I don't yet have a strong idea how much additional code this would require. Before I flew off the handle and tried to bash out the code, I thought it might be wise to check with the maintainers. :smiley:

From zeromq.org:

We recommend anyone using 3.2.x or 2.2.x to upgrade to 4.1.x.

So the official wisdom seems to be that I should upgrade my applications instead of shoehorning support into this library, but I'm curious what everyone here thinks. Is there any value in this?

drozzy commented 7 years ago

I, personally, am all for backwards interoperability, as long as it does not break the present functionality. The only reason for not implementing it was just lack of time/necessity. If you contribute the code, it will absolutely be merged!

Regarding the general wisdom, that's up to you to decide. What will take longer: implement backwards interop or switch your apps to newer version of libzmq?

tvjg commented 7 years ago

What will take longer: implement backwards interop or switch your apps to newer version of libzmq?

Technically, I have a third option open as well -- use erlang-czmq. I adopted this approach in the prototype I'm building to avoid thinking about the versioning issue altogether for now. For the amount of traffic I'm expecting, I think the performance should be fine and it's easy enough to isolate it in a supervision tree. That said, I still think chumak is a better way forward for the erlang community.

Since you're on board @drozzy, I will try to have a go at this in my spare time and see what I can do. I'm still fairly new to erlang, but learning quickly. Do you have any advice on the approach? How about I see if I can work out the greeting frame changes to detect the version and then you can review and tell me if it's heading in the right direction?

drozzy commented 7 years ago

@tvjg by all means. Just go ahead and make the change and if it breaks something we'll fix it.

If you need help with erlang I suggest slack channel (get invite here: https://erlang-slack.herokuapp.com/) https://erlanger.slack.com/. For a quicker turnaround, I find it useful to frequent Elixir's channel as well: https://elixir-slackin.herokuapp.com/

Feel free to write here as well, but the time to respond may be slower.

drozzy commented 5 years ago

I’m going to close this for now. Feel free to open another issue.