Skip to content
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

Redis key / value serializer #34329

Closed
RomainWilbert opened this issue Jun 27, 2023 · 11 comments · Fixed by #34486
Closed

Redis key / value serializer #34329

RomainWilbert opened this issue Jun 27, 2023 · 11 comments · Fixed by #34486
Assignees
Labels
area/redis kind/enhancement New feature or request
Milestone

Comments

@RomainWilbert
Copy link

Description

We should be able to customize serializers/deserializers for redis operations. This would allow to add type metadata in json (i.e. support generic objects in json).

Implementation ideas

No response

@RomainWilbert RomainWilbert added the kind/enhancement New feature or request label Jun 27, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 27, 2023

/cc @cescoffier (redis), @gsmet (redis), @machi1990 (redis)

@cescoffier
Copy link
Member

Would having support for TypeReference be enough?

@RomainWilbert
Copy link
Author

It would be nice to be able to configure Jackson ObjectMapper and set default typing.

@cescoffier
Copy link
Member

@RomainWilbert
Copy link
Author

What if you use Jackson for Redis and elsewhere to make rest calls ?

@cescoffier
Copy link
Member

It uses the same mapper. Mapper are heavy objects. We don't want to create many of them.

@RomainWilbert
Copy link
Author

RomainWilbert commented Jun 28, 2023 via email

@cescoffier
Copy link
Member

So, you would need a separate mapper?

@RomainWilbert
Copy link
Author

RomainWilbert commented Jun 29, 2023 via email

@cescoffier
Copy link
Member

Yes, I was thinking about that. The memory cost is annoying. I am trying to see if Jackson has some hidden gems to avoid that.

@cescoffier cescoffier self-assigned this Jul 3, 2023
cescoffier added a commit to cescoffier/quarkus that referenced this issue Jul 3, 2023
@cescoffier
Copy link
Member

Ok... so I tried to customize the ObjectMapper, but it turned out to be a dead end.

Thus, I implemented something I had wanted to do since day 1: custom codecs.
See #34486.

You can now implement your own codec for a specific type. Implementations are beans, so it can get config values and other beans.

cescoffier added a commit to cescoffier/quarkus that referenced this issue Jul 3, 2023
@quarkus-bot quarkus-bot bot added this to the 3.3 - main milestone Jul 4, 2023
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redis kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants