Skip to content

The implementation of GenericJackson2JsonRedisSerializer has changed in a non-back-compatible manner again? #2454

@LoganWlv

Description

@LoganWlv

We have a similar use case with multiple services than #2396.
Different serialization results for the same object lead to multiple serialization issues when updating services.

spring-data-redis 2.7.0:

{
  "@class": "some-path.DataBaseSizeLimit",
  "maxNumberRows": [
    "java.lang.Long",
    50
  ],
  "maxNumberColumns": 50,
  "maxNumberZipCodes": 50
}

spring-data-redis 2.7.5:

{
  "@class": "some-path.DataBaseSizeLimit",
  "maxNumberRows": 50,
  "maxNumberColumns": 50,
  "maxNumberZipCodes": 50
}

We're now thinking of adding eviction strategies, one temporary fix was to create a class CustomJacksonRedisSerializer that holds both ObjectMapper from GenericJackson2JsonRedisSerializer 2.7.0 & 2.7.5, then try one, if it fails use the other one.
Is it to be expected for a 5 patch jump?

The object:

public class DataBaseSizeLimit {

    private Long maxNumberRows;

    private Integer maxNumberColumns;

    private Integer maxNumberZipCodes;

    public DataBaseSizeLimit() {}

    public DataBaseSizeLimit(
        Long maxNumberRows,
        Integer maxNumberColumns,
        Integer maxNumberZipCodes
    ) {
        this.maxNumberRows = maxNumberRows;
        this.maxNumberColumns = maxNumberColumns;
        this.maxNumberZipCodes = maxNumberZipCodes;
    }

    public Long getMaxNumberRows() {
        return maxNumberRows;
    }

    public Integer getMaxNumberColumns() {
        return maxNumberColumns;
    }

    public Integer getMaxNumberZipCodes() {
        return maxNumberZipCodes;
    }
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions