-
Notifications
You must be signed in to change notification settings - Fork 829
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
How to achieve the Kryo various functionality without registering the classes #770
Comments
Hi @sandeep27st,
You can simply switch to optional registration via
Kryo does not have any built-in encryption support. You can encrypt/compress the resulting bytes in any way you like.
Kryo has 3 built-in serializers that enable some degree of backwards/forwards compatibility: Please read the documentation and chose the serializer most appropriate for your use-case.
Not to my knowledge. |
Thanks @theigl I appreciate this quick reply. Can you please provide the test case of each of the following? I have checked your test cases I didn't find appropriate.
These classes of these objects are from the different library (saaj, java classes, jdom), I can not provide the annotation on them, I can provide the serializer if possible for the renaming the field and removing the field. But that too should not be required in case of multiple new fields added. If we say we can serialize and deserialize without registering classes then, but when configuring the compatibility expects the class type. Which contradicts your first sentence. The addition of the field should be handle without an error. We have a requirement, where we persist in the user data. We have an automation solution, where we used to capture the user variables. User can generate any variable, it can be from other libraries as well, like JDOM document, w3c. Document., List, and many more. Once these are defect user can trigger the solution to generate the transaction. Generated transaction data we might require in many petty cases like e.g. retry the transaction. Thanks, |
Hi @sandeep27st, I'm afraid your use case is too complex for current built-in serializers. If you cannot annotate your target classes, your only option is You will have to extend |
Do we need this upfront before serializing the object of a particular class? What if at the time of deserialization (Later changed of some library consumed as we previously on JDOM 1.1.x and in the newer version we upgrade to JDOM 2.x.x) we come to know the change in the class? Can we create our own serializer for the same? Can we perform the post-processing on that deserialized object after Kryo completes its task for the object? because I have seen data of newly introduced field is lost when Kryo automatically handle this please check the following example: the previous structure of class:
Later I have changed it to:
int_field1 becomes 0 after deserialization . And if the Type of field change is not supported what should be a workaround. how we can skip and achieve this? XStream serialized to plain text format and which is too in tag structure like |
Would be nice if "Rename and package change are not supported" were added to the wiki as limitations in Compatibility section. |
@krishna81m: If you have suggestions for the wiki, please edit the readme and create a PR. I'm always happy to merge documentation improvements. |
Hello,
Currently, in our application, we are using the XStream serializer to serialize classes and hierarchy of classes.
In XStream, we are not bothering about registering the classes. All the operations will perform on the serialized string later after the serialization process.
We can not register the class as our class hierarchy, as it can be n level deep and it also contains the user classes.
We are now, in the process of moving to Kryo for the performance purpose Can you please suggest the following:
Hope you will soon answer my queries and I appreciate the help in advance.
Thanks,
The text was updated successfully, but these errors were encountered: