-
Notifications
You must be signed in to change notification settings - Fork 39
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
Java code-first SDK: support for Akka's Jackson migration #1332
Comments
In addition to Akka's Jackson migration, we could also imagine some tooling to map old typeUrl to need. Something that will free the users to deal with |
I was doing some experiments mainly for my own understanding of what was possible already or not, so here are some notes here:
Akka Jackson migration will be needed to:
|
Json behaves similar to proto with respect to unknown fields. The main issue is renaming indeed. Renaming is no issue for gRPC, only ordering matters. Changing type is a major problem for gRPC as well. And I don't think we should even try to solve this kind of problems. Good that Akka Jackson Migration have already some support for it, even if limited that's already something. We are fine as long as we document the limitations. Speaking about documenting migration, I don't think we have anything about protobuf and we simply expect that users will know how to evolve their protobuf. That's probably too optimistic. I hear often that schema evolution is not an issue for protobuf. That's true only if you know what you are doing. The reality, is that very often people change their format without much care. |
Side note: Re the protobuf schema evolution, we don't really link to it from our docs (we should), but there is information in the protobuf documentation: https://protobuf.dev/programming-guides/proto3/#updating |
Ok, I'm experimenting with a similar approach to Akka Jackson Migration. The biggest challenge is how to save the version number. My idea is to use the |
|
While working on this I've found a bug: https://github.com/lightbend/kalix-proxy/issues/2093 Even after fixing it, users might fall into a very problematic scenario. Let's imagine that I have a
I'm deploying a new version of the app, with renamed event
In case of lagging, there could be a situation where the subscription will receive (after the restart) events: Because To know about the problem we would need to recover some old entity with the old event name. Unfortunately applying proper migration will solve only the recovery aspect, the subscription will continue the work. Except for not using (or carefully using) the ignore option I don't think there is a good solution for that. We should strongly recommend the TypeName annotation, which is also a solution to this problem. |
One interesting thing about Views + Migration is that we can now support the schema evolution of VE state model. For instance, we could have:
after some time this could be changed to:
A view can be created with a dummy transformation, that just returns the deserialized state, and the
|
Ok, so |
Another interesting observation. Let's say we have a Wallet Entity:
and we are calling the
If so, the deserialization is done via Spring Web Client internals without (our) If we do the same, but the call will be to an external Kalix service. Not only should we recommend using
to avoid sending FQCN. We are talking about mixed usage: rest calls + deferred calls. JSON migration, unless we tweak the Web Client, applies only to deferred calls. |
No description provided.
The text was updated successfully, but these errors were encountered: