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

TopicResolver uses map<CLass<*>, topicname>. Failure with spring-devtools #1078

Open
fkurth opened this issue Apr 4, 2025 · 1 comment
Open
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@fkurth
Copy link

fkurth commented Apr 4, 2025

The DefaultTopicResolver uses a Map with Class<*> as key.

This fails if the project uses multiple classloaders, because Class<> has no equal implementation, every classloader creates a different "version" of the class.

For example, register custom mappings and add spring-devtools to the project.
This brings in a "RestartableClassLoader".
Other instrumentations might lead to similar problems.

The TopicResolver will fail for the custom mappings.

https://docs.spring.io/spring-boot/reference/using/devtools.html#using.devtools.restart.disable
https://stackoverflow.com/questions/2625546/is-using-the-class-instance-as-a-map-key-a-best-practice

Version 1.2.4

@onobc
Copy link
Collaborator

onobc commented Apr 6, 2025

Hi @fkurth , thanks for the report. We will take a look.

@onobc onobc added the status: waiting-for-triage An issue we've not yet triaged label Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants