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

Generic RedisKeyExpiredEvent not delivered to @EventListener anymore in 6.0.9 #30712

Closed
on-delete opened this issue Jun 21, 2023 · 3 comments
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Milestone

Comments

@on-delete
Copy link

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?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 21, 2023
@jhoeller
Copy link
Contributor

This could be a regression caused by #30399.

Does it work if you declare RedisKeyExpiredEvent<?> or a raw RedisKeyExpiredEvent without any generic?

@jhoeller jhoeller added type: regression A bug that is also a regression in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 21, 2023
@jhoeller jhoeller self-assigned this Jun 21, 2023
@jhoeller jhoeller added this to the 6.0.11 milestone Jun 21, 2023
@jhoeller
Copy link
Contributor

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.

@jhoeller jhoeller changed the title No RedisKeyExpiredEvent with spring-context 6.0.9 Generic RedisKeyExpiredEvent not delivered to @EventListener anymore in 6.0.9 Jun 21, 2023
@on-delete
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants