curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roshan Ail (JIRA)" <>
Subject [jira] [Commented] (CURATOR-5) Make JsonInstanceSerializer#deserialize leverage ServiceInstanceBuilder
Date Tue, 20 Jan 2015 18:20:34 GMT


Roshan Ail commented on CURATOR-5:

Can the serializer be changed to not use jackson?
There are incompatibilities between different versions of jackson.
We are using jackson 1.6.2 for our apis.
When I took it out to use the one included with the service provider it broke the serialization
for a lot of our rest apis.

To get around it I pulled the source for the curator project and modified service discovery
to take out jackson. I added a Gson serializer instead, built it and added that into the project.

It would be great if the ServiceInstanceBuilder just took a byte[] for the payload or allowed
a custom serializer. That would avoid problems with jackson.

> Make JsonInstanceSerializer#deserialize leverage ServiceInstanceBuilder
> -----------------------------------------------------------------------
>                 Key: CURATOR-5
>                 URL:
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Recipes
>    Affects Versions: 2.0.0-incubating
>            Reporter: Jordan Zimmerman
>            Priority: Minor
>             Fix For: TBD
> From
> Proposing a way to change JsonInstanceSerializer leverage ServiceInstance's builder pattern
> See discussion and request to generate a patch here:
> ===
> It's possible a lot of the lower-level JSON deserialization code in JsonInstanceSerializer#deserialize()
could be passed off to Jackson if ServiceInstanceBuilder's setters also followed the bean
patterns (e.g. setId() versus id()). If ServiceInstanceBuilder followed this pattern, Jackson's
standard bean deserialization could, I believe, deserialize directly into the ServiceInstanceBuilder
and JsonInstanceSerializer#deserialize() could use that higher-level pattern to eliminate
a fair chunk of code here.
> ===
> So, why don't we make ServiceInstanceBuilder follow the bean API? Can you update this
pull to reflect that? I suggest leaving the old builder-style methods and marking them as
deprecated. This way it won't break existing users.

This message was sent by Atlassian JIRA

View raw message