-
Notifications
You must be signed in to change notification settings - Fork 67
TopicResolver uses map<CLass<*>, topicname>. Failure with spring-devtools #1078
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
Labels
type: improvement
An improvement of implementation of existing feature
Comments
Hi @fkurth , thanks for the report. We will take a look. |
onobc
added a commit
to onobc/spring-pulsar
that referenced
this issue
Apr 18, 2025
This commit updates the DefaultTopicResolver and DefaulSchemaResolver to use String class names rather than Class instances as map keys for their custom mappings. Resolves spring-projects#1078
onobc
added a commit
to onobc/spring-pulsar
that referenced
this issue
Apr 21, 2025
This commit updates the DefaultTopicResolver and DefaulSchemaResolver to use String class names rather than Class instances as map keys for their custom mappings. Resolves spring-projects#1078
Hi @fkurth , Thanks |
onobc
added a commit
to onobc/spring-pulsar
that referenced
this issue
Apr 21, 2025
This commit updates the DefaultTopicResolver and DefaulSchemaResolver to use String class names rather than Class instances as map keys for their custom mappings. Resolves spring-projects#1078
onobc
added a commit
to onobc/spring-pulsar
that referenced
this issue
Apr 21, 2025
This commit updates the DefaultTopicResolver and DefaulSchemaResolver to use String class names rather than Class instances as map keys for their custom mappings. Resolves spring-projects#1078
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: