socketcluster-client-java icon indicating copy to clipboard operation
socketcluster-client-java copied to clipboard

Allow user to add custom codecEngine

Open AUT0CRAT opened this issue 6 years ago • 8 comments

PR for #10 A basic implementation of Binary Codec for JAVA client.

AUT0CRAT avatar Mar 22 '18 10:03 AUT0CRAT

Hi @AUT0CRAT , will take a look at PR and get back to you :+1:

sacOO7 avatar Mar 22 '18 18:03 sacOO7

@AUT0CRAT Could you please provide an example of how the codec is used, possibly adding some testing code to Main class? I'm not really sure the codec will work as intended, not with the current Socket implementation supporting only the NV client's WebSocket.sendText() and converting the JSON object to String before sending it.. I think support for binary WebSocket frame sending should be implemented first, prior to adding SC codecs support.. Btw, I'm planning on doing it soon..

XDex avatar Mar 26 '18 15:03 XDex

Hi @AUT0CRAT , it will be helpful if you can provide working example. I will try to integrate it by trying out send method with binary data.

sacOO7 avatar Mar 26 '18 18:03 sacOO7

Hi @XDex , if you know how to use code defined in PR, it will be useful if you can post working example here 👍 or create PR for it.

sacOO7 avatar Apr 03 '18 05:04 sacOO7

@sacOO7 Actually, I'm now working on adding support for sc-min-bin codec in my own fork, however I have refactored it to work with Jackson instead of org.json JSON serializer, as implementation is much simpler with jackson-dataformat-msgpack MsgPack plugin. I can raise a PR once I'm done, however I guess many people would prefer to have a more lightweight implementation without binary codecs support, so maybe it makes more sense to publish it as a separate project, WDYT?

XDex avatar Apr 03 '18 08:04 XDex

Hi @XDex , I don't think making a separate project a good idea. We have already decided to keep one client per language (since too many clients is creating problem for users to choose one) . It's better if we can keep it at one place. It's easy to maintain that way, and also people can raise and find issues at one place. I don't think 3-4 class files for managing codecs will make implementation heavy as a library ..

sacOO7 avatar Apr 05 '18 06:04 sacOO7

@sacOO7 Generally I agree with your point, however it's always better to offer users choice when the differences are too big and breaking, which is the case here.. I've noted the differences here, and unfortunately they are quite impacting: ~150 Kb JAR vs ~1.8 Mb, plus breaking API changes..

XDex avatar Apr 05 '18 09:04 XDex

HI @XDex , do you have any plans to release library with sc codec min? I mean we can conclude on solution which will work for us... Even keeping the library size as small as possible...

sacOO7 avatar Jun 25 '18 18:06 sacOO7