-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Unable to set a compression input/output decorator to a SmileFactory
#153
Comments
Thank you for reporting this. I hope to look into this soon -- decoration may not be properly tested for all codec factories, but obviously should work. |
Ah-ha. Looks like there's "double decoration" for particular parser factory method(s). I'll try to create good regression test here. |
@guidomedina I found the problem, and it affects |
SmileFactory
Hi @cowtowncoder thanks for the fix, I'll wait for 2.9.8 because I also added converters from one or more mappers to another on the fly for our data so the migration happens seamlessly. We basically use a mapper based on the
With this fix now we will be able to add:
I know this has nothing to do with the issue; I'm just trying to give you another scenario of how your awesome APIs are put to use, keep up the great work you do ;-) |
@cowtowncoder do you have any ETA for releasing 2.9.8? I have to do some big data migration and I was hoping I could do it during the next weekend, I'm postponing it in order to get the Or maybe in the meantime I use the work around but didn't understand from your previous comment how to do it exactly. |
Hi there! I am quite close to having Exciting to hear about usage: I am glad you found this feature useful -- it's one of those things that is bit under-utilized, and this is also why there was that bug (not enough usage to weed out). Funny part is that 3.0 branch (master) had a fix, due to sharing more code across stream factories. As to workaround, I guess I now realized that if you do not control which One other thing is that depending on how you release/deploy, you could perhaps do local build of |
This is the result with my newly build
|
Hi Guido, I hope you are doing well through this COVID-19 time we are living. We have custom Spring Cloud Stream message converters to handle content negotiation based on the headers of the incoming RabbitMQ messages. LZ4 is one of the compressors we want to use by decorating the ObjectMapper (same thing you did), but couldn't get closer to the numbers you posted. We try 2 different implementations of the algorithm:
We are using Jackson v2.11.0. If you don't mind could you share which LZ4 implementation you used? Best regards, |
I'm using LZ4 double compression with 32KB block size, also because it is binary and Smile is faster than standard Json when I use some binary compression I'm using Smile straight forward, I'm using:
Here is the code for LZ4 Json mapper and LZ4 Smile mapper:
|
The result will vary, I tried with a Json with many repetitions (an array of objects) which Smile will compress very well before reaching the LZ4 or Gzip compression, also; for Gzip I just used the standard JDK implementation, I kind of avoid using Apache common compressors where possible, I have had bad experience with them. |
Thank so much for posting the code and for your detailed explanation. I'm gonna your configurations and see how it goes!! |
I have a special need for the
riak-java-client
which only allows me to use anObjectMapper
to serialize/deserialize key-values, I would like to decorate aSmileFactory
with compressors like LZ4, Snappy or GZip but at the moment this is not possible, when I try a mapper like the following:This is the exception I get:
I used Gzip as an example, in reality I'm using both LZ4 and Gzip and both throw exceptions when I try with a
SmileFactory
, this works perfectly with aJsonFactory
, the reason for me to prefer aSmileFactory
over aJsonFactory
is because it is notice-able faster than theJsonFactory
so basically it'll help compensate the price I pay for compression.The text was updated successfully, but these errors were encountered: