-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Improve generated default name for @JmsListener
subscription
#29790
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
Conversation
Could this also be backported to the 5.x line? |
The previous commit changed the generated default name for a JMS subscription to <FQCN>#<method name> -- for example: - org.example.MyListener#myListenerMethod In order to generate unique subscription names for overloaded listener methods within a class, this commit retains the <FQCN>#<method name> format for a method that declares zero parameters but changes the format to <FQCN>#<method name>(<parameter list>) for methods that declare parameters, where the parameter list is a comma-separated list of the canonical names of the parameter types -- for example: - org.example.MyListener#myListenerMethod - org.example.MyListener#myListenerMethod(java.lang.String) - org.example.MyListener#myListenerMethod(byte[]) - org.example.MyListener#myListenerMethod(byte[],java.lang.String) See spring-projectsgh-29790
@JmsListener
subscription
As a proof of concept, I pushed changes to main...sbrannen:spring-framework:issues/gh-29790-default-jms-subscription-name that include the method signature in the generated subscription name (in order to generate unique subscription names for overloaded However, before pushing those changes I decided to verify the requirements of a subscription name in the JMS 3.0 spec. That points out that characters such as In light of that, I have decided to use a |
The previous commit changed the generated default name for a JMS subscription to <FQCN>#<method name> -- for example: - org.example.MyListener#myListenerMethod However, the JMS spec does not guarantee that '#' is a supported character. This commit therefore changes '#' to '.' as the separator between the class name and method name -- for example: - org.example.MyListener.myListenerMethod This commit also introduces tests and documentation for these changes. See gh-29790
Yes, we will backport this to |
This is perfectly OK for me. The main thing is that the name is meaningful and not fixed and is equal to the name of a rather internal Spring class. |
This should fix #29763.