You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working with Java SDK 1.10 to store a POJO in MongoDB, and I've encountered an issue with the default serialization. When I save the POJO, the result is stored as a string in MongoDB, like this:
value: '{product: "prod", name: "example"}'
I attempted to create a custom serialization using a Jackson object mapper, but unfortunately, the result remains the same:
OBJECT_MAPPER.writeAsByte(pojo)
What I'm aiming for is to have the POJO stored as an object in MongoDB, like this:
value: {
product: "prod",
name: "example"
}
The text was updated successfully, but these errors were encountered:
Same problem here. It seems that DAPR is able to save state as JSON (queryable format) only using HTTP API protocol. It is also used in the demo @artursouza linked.
-Ddapr.api.protocol=HTTP
Unfortunately HTTP API protocol is marked as deprecated in the Java SDK so it's not a very good workaround. It would be nice to have it working with the default gRPC protocol.
Hello,
I'm currently working with Java SDK 1.10 to store a POJO in MongoDB, and I've encountered an issue with the default serialization. When I save the POJO, the result is stored as a string in MongoDB, like this:
value: '{product: "prod", name: "example"}'
I attempted to create a custom serialization using a Jackson object mapper, but unfortunately, the result remains the same:
OBJECT_MAPPER.writeAsByte(pojo)
What I'm aiming for is to have the POJO stored as an object in MongoDB, like this:
The text was updated successfully, but these errors were encountered: