Closed spring-projects-issues closed 4 years ago
Christoph Strobl commented
The setup seems rather complex which makes it hard to narrow down the cause of the issue. Can you craft a minimal sample reproducing the error? Something like a failing integration test maybe?
Kevin Madhu commented
Christoph Strobl Please take a look at this project. I've removed all the unnecessary dependencies and code and narrowed it down to the issue. It only needs Redis to be running.
"GET /trigger" request triggers the addition of record to the Redis stream. https://github.com/kevin-madhu/spring-data-redis-example
Kevin Madhu commented
Christoph Strobl Please take a look at this project. I've removed all the unnecessary dependencies and code and narrowed it down to the issue. It only needs Redis to be running.
"GET /trigger" request triggers the addition of record to the Redis stream. https://github.com/kevin-madhu/spring-data-redis-example
Christoph Strobl commented
As it seems the @TypeAlias
is only used when writing the entity but not on read. Can you please remove it for now while we investigate the issue in more detail.
Kevin Madhu commented
Christoph Strobl I've commented it out now
Kevin Madhu commented
Christoph Strobl Thanks for the fix :)
Kevin Madhu opened DATAREDIS-1179 and commented
Currently, I'm writing an object into Redis stream using ObjectRecord and when I try to read the same entry from the stream using another project with the target type as a class with the same properties, the program just crashes throwing an Exception.
The code could be found in the following links under the multitenancy branches. https://github.com/muellners/finscale-core https://github.com/muellners/finscale-identity
The classes in these projects relevant to this issue are:
1) org.muellners.finscale.core.config.RedisConfiguration
https://github.com/muellners/finscale-core/blob/multitenancy/src/main/kotlin/org/muellners/finscale/core/config/RedisConfiguration.kt
2) org.muellners.finscale.core.service.impl.TenantServiceImpl
https://github.com/muellners/finscale-core/blob/multitenancy/src/main/kotlin/org/muellners/finscale/core/service/impl/TenantServiceImpl.kt
3) org.muellners.finscale.identity.config.RedisConfiguration
https://github.com/muellners/finscale-identity/blob/multitenancy/src/main/kotlin/org/muellners/finscale/identity/config/RedisConfiguration.kt
4) org.muellners.finscale.identity.config.RedisStreamConfiguration
https://github.com/muellners/finscale-identity/blob/multitenancy/src/main/kotlin/org/muellners/finscale/identity/config/RedisStreamConfiguration.kt
5) org.muellners.finscale.identity.service.TenantConsumerService
https://github.com/muellners/finscale-identity/blob/multitenancy/src/main/kotlin/org/muellners/finscale/identity/service/TenantConsumerService.kt
Something I've noted is that when I replaced
with
everything worked. So, it's got something to do with the mapper to an object I guess.
Inside org.springframework.data.redis.connection.stream.MapRecord, there's this function which is called
In this, mapper.fromHash((Map) getValue() returns null
Affects: 2.3.1 (Neumann SR1)
Attachments:
Referenced from: pull request https://github.com/spring-projects/spring-data-redis/pull/548
Backported to: 2.3.2 (Neumann SR2)