New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kill Newtonsoft.Json dependency #237
Comments
IMHO it is not a bad idea, but we must consider that instead of logging, serializing is a mandatory part, so we could think about using by defaul the DataContractSerializer (or XmlSerializer), and let the user change it like for IEasyNetQLogger, but we could also consider to simply add a separated nuget package, like "EasyNetQ.Newtonsoft.Json", to maintain the friction-less of EasyNetQ installation, for whom do not care about external dependencies, then make some kind of dynamic dependency resolution with MEF or manually using What do you think? |
Hi Yuri, I'd be against removing serialization. It would put a big boundary for Mike On Mon, Jul 14, 2014 at 2:52 PM, Yury Pliner notifications@github.com
|
I like the idea of ILMerge. I just have experience with red-gate smart assembly, that also can merge dependencies in one binary. I don't know how ILMerge solve the problem of having two version of the same assembly in the same application domain, maybe is not a problem for JIT. Edit: Yes, it is possibile to
some other readings: |
Effectively ILRepack creates a single assembly out of several separate On Mon, Jul 14, 2014 at 3:13 PM, Michael Denny notifications@github.com
|
I just tried out ILRepack. It seems to work. I've been able to create a I'd quite like to go with this and see if it works for people. What do you Mike On Mon, Jul 14, 2014 at 3:28 PM, Mike Hadlow mike@suteki.co.uk wrote:
|
I think people will need to manually remove the other dependencies that were added by easynetq before. You could write this note inside the nuget package:
For me is 👍 |
I like this approach as well. Thanks, guys! |
Another option would be to use simplejson and let people opt in to the newtonsoft.json dependency. simplejson is surprisingly good and it just installs as a .cs file in your project. SimpleJson: https://github.com/facebook-csharp-sdk/simple-json |
Nice idea @jonnii but does SimpleJson has also all the attributes that newtonsoft has? Because otherwise could become a big breaking changes for who is using those attributes (not me 😄), yes, of course they can set newtonsoft serializer again while creating the bus, but the ones that already has code in production, well, dunno if they're will so happy. Actually yes, this preserve the easy-peasy idea of mike, for who is approaching to EasyNetQ for the first time, and will remove 489 KB of dll (952 KB with xml doc). Is there any performance comparison out there? What do you think @mikehadlow ? |
Hmm, changing the serializer has the potential to break people's work in On Mon, Jul 14, 2014 at 4:33 PM, Michael Denny notifications@github.com
|
If you're worried about performance then you shouldn't be using newtonsoft.json or any json serializer but using something like msgpack or protobufs etc... I'm 👎 on interning the rabbitmq client, I think that's too opaque. |
OK, how about we initially go for interning (is that the word?) On Mon, Jul 14, 2014 at 4:47 PM, Jonathan Goldman notifications@github.com
|
I agree to avoid interning RabbitMQ.Client, because if a bug-fix is released by RabbitMQ team you need to wait a new EasyNetQ package, instead now you can update the rabbitmq.client assembly and often that it sufficient. 👍 to initially internalize just Newtonsoft.Json |
Oh... Very hot discussion :) Thanks guys for answers! 👍 to internalize just Newtonsoft.Json |
I agree with Michael. Prefer to IL Merge just the json serializer, not the On Mon, Jul 14, 2014 at 9:01 AM, Michael Denny notifications@github.com
|
OK, I'll look at getting a new version of EasyNetQ with interned On Mon, Jul 14, 2014 at 5:06 PM, Jeff Doolittle notifications@github.com
|
Many thanks, Mike! |
OK, it's all done. Verison 0.35.0 onwards has Newtonsoft.Json merged. On Tue, Jul 15, 2014 at 10:47 AM, Yury Pliner notifications@github.com
|
great job @mikehadlow !! Many thanks! |
@mikehadlow you said that with ILRepack
When I switched the the new ILRepack version of EasyNetQ, it doesn't pick up my |
It's because EasyNetQ now references its internal Newtonsoft.Json assembly The easy way to make it work is to recreate the JsonSerializer: https://github.com/mikehadlow/EasyNetQ/blob/master/Source/EasyNetQ/JsonSerializer.cs ... and register it with EasyNetQ as a new component: https://github.com/mikehadlow/EasyNetQ/wiki/Replacing-EasyNetQ-Components I hope this helps, On Thu, Jul 24, 2014 at 12:03 PM, Fydon notifications@github.com wrote:
|
Thank you for the quick response. Yes that solved it. |
Hi!
I have a small trouble after last update of newtonsoft.json to 6 version.
A lot of libraries use 4.5 version of this library.
What do you think about removing serialization dependency from easynetq and give this responsibility to user as it's done with IEasyNetQLogger?
Also there is an option to do an built in implementation without any dependencies.
The text was updated successfully, but these errors were encountered: