I upgraded spring-boot from 6.0.8 to 6.0.9 and noticed, that my @EventListener is not receiving any RedisKeyExpiredEvent anymore. The method is simply not called. If i use spring-context in version 6.0.8, everything is working fine. So i assume something has changed in this version, which causes this not receiving event anymore.
I enabled the redis events like this on my Application:
@EnableRedisRepositories(enableKeyspaceEvents = RedisKeyValueAdapter.EnableKeyspaceEvents.ON_STARTUP)
The method is annotated like this:
@EventListener
public void expiredConfiguredLogLevel(RedisKeyExpiredEvent<ConfiguredLogLevel> redisKeyExpiredEvent){...}
Am i missing something or is this a bug in this version?
Comment From: jhoeller
This could be a regression caused by #30399.
Does it work if you declare RedisKeyExpiredEvent<?>
or a raw RedisKeyExpiredEvent
without any generic?
Comment From: jhoeller
I can reproduce this so far that custom generics in an unresolved fashion do not match anymore after that change in 6.0.9. Generally speaking such an event should implement ResolvableTypeProvider
(analogous to our core PayloadApplicationEvent
) but we should keep leniently matching it even if it does not indicate a specific generic type. To be fixed for 6.0.11.
Comment From: on-delete
Hey @jhoeller thanks for the quick reply. Yes i can confirm that with wildcard the event is delivered again.
I think, not setting the generic type is a sufficient workaround for us, as we do not have any other expiry events for other keys in place. Switching back after the new version is released.
Thanks for your help.