Skip to content

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

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions