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

Optimize a MessagingMessageListenerAdapter returning null from the DelegatingInvocableHandler.invoke() #3697

Open
artembilan opened this issue Dec 31, 2024 · 4 comments · Fixed by #3710 · May be fixed by #3722
Open

Optimize a MessagingMessageListenerAdapter returning null from the DelegatingInvocableHandler.invoke() #3697

artembilan opened this issue Dec 31, 2024 · 4 comments · Fixed by #3710 · May be fixed by #3722

Comments

@artembilan
Copy link
Member

Right now the DelegatingInvocableHandler.invoke() always returns an InvocationResult even if result == null.
In the end we may just have a log message like:

Async result is null, ignoring

which is not always true for the regular void @KafkaHandler method.

Changing the logic in the mention method to:

		if (result != null) {
			return new InvocationResult(result, this.handlerSendTo.get(handler),
					this.handlerReturnsMessage.get(handler));
		}
		else {
			return null;
		}

would make some optimization where we would not try to resolve any reply attempts and creation of many interim objects like CompletableFuture.

Since this would be a breaking change, the issue is scheduled for the next 4.0 major version.

@ivamly
Copy link
Contributor

ivamly commented Jan 16, 2025

Hi, @artembilan!

Could I work on this issue?

Thanks!

@sobychacko
Copy link
Contributor

@ivamly Yes, please go ahead.

ivamly added a commit to ivamly/spring-kafka that referenced this issue Jan 16, 2025
…turning null from the DelegatingInvocableHandler.invoke()
ivamly added a commit to ivamly/spring-kafka that referenced this issue Jan 16, 2025
ivamly added a commit to ivamly/spring-kafka that referenced this issue Jan 16, 2025
…turning null from the DelegatingInvocableHandler.invoke()

Signed-off-by: ivamly <[email protected]>
ivamly added a commit to ivamly/spring-kafka that referenced this issue Jan 16, 2025
@sobychacko sobychacko modified the milestones: Backlog, 3.3.2 Jan 16, 2025
spring-builds pushed a commit that referenced this issue Jan 16, 2025
* Optimize a MessagingMessageListenerAdapter returning null from the DelegatingInvocableHandler.invoke()

Fixes: #3697

Signed-off-by: ivamly <[email protected]>

(cherry picked from commit 004fd52)
sobychacko added a commit to sobychacko/spring-kafka that referenced this issue Jan 16, 2025
@sobychacko sobychacko reopened this Jan 16, 2025
@sobychacko
Copy link
Contributor

See the comment on the latest PR.

@ivamly
Copy link
Contributor

ivamly commented Jan 17, 2025

I'll make another PR soon, no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants