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

StackOverflowError when using MessageListenerAdapter without delegate [SPR-5309] #9982

Closed
spring-projects-issues opened this issue Nov 18, 2008 · 3 comments
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Alexander Grupe opened SPR-5309 and commented

When using the constructor without specifying a delegate...

public MessageListenerAdapter() {
	initDefaultStrategies();
	this.delegate = this;
}

...the next call to getSubscriptionName leads to an endless loop:

public String getSubscriptionName() {
	if (this.delegate instanceof SubscriptionNameProvider) {
		return ((SubscriptionNameProvider) this.delegate).getSubscriptionName();
	}
	else {
		return this.delegate.getClass().getName();
	}
}

This is for example called in AbstractMessageListenerContainer.setMessageListener. Before the introduction of SubscriptionNameProvider in 2.5.6, by default the message listener's class name was used.


Affects: 2.5.6

Referenced from: commits 2674b13

3 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

Alexander Grupe commented

Addendum: The reason for the endlees loop is that MessageListenerAdapter implements SubscriptionNameProvider itself.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Thanks for pointing this out! Fixed in 3.0 M2 now.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Lars Oppermann commented

It would be nice to have a fix for this in the 2.5 branch

@spring-projects-issues spring-projects-issues added type: bug A general bug in: messaging Issues in messaging modules (jms, messaging) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 M2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants