Skip to content

Conversation

@dmitrysulman
Copy link
Contributor

@dmitrysulman dmitrysulman commented Sep 12, 2025

This PR updates RSocketServiceMethod to allow using the @RSocketExchange annotation with Kotlin suspending functions when used as RSocket requester.

Fixes #34868

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 12, 2025
@dmitrysulman dmitrysulman changed the title Add RSocketServiceMethod support for suspending functions Add RSocketServiceMethod support for Kotlin suspending functions Sep 12, 2025
@doxlik
Copy link

doxlik commented Sep 12, 2025

@dmitrysulman hello, dear Dmitry. Can you please also add test cases for streaming?

At least requestStream that return Flow. Because I also was doing poc of this feature (just for interest) and Flow return type most probably will be covered by ReactiveAdapterRegistry, but still it is good for it to also be covered by test.

And also meanwhile I am not sure if the requestChannel will correctly handle Flow as argument, so also good to be covered with test.

Will be very grateful if you have time to add it and thank you for your contribution.

@dmitrysulman dmitrysulman force-pushed the rsocket-interface-coroutine branch 2 times, most recently from 350082c to 255ef56 Compare September 13, 2025 16:24
@dmitrysulman
Copy link
Contributor Author

@doxlik done, Request Stream and Request Channel suspending functions (using Flow as the return type) are now supported.

The Flow type argument for Request Channel is handled correctly: PayloadArgumentResolver delegates to the relevant ReactiveAdapter.

@sdeleuze sdeleuze self-assigned this Sep 13, 2025
@sdeleuze sdeleuze added in: messaging Issues in messaging modules (jms, messaging) theme: kotlin An issue related to Kotlin support labels Sep 13, 2025
@sdeleuze sdeleuze added this to the 7.0.0-RC1 milestone Sep 13, 2025
@sdeleuze sdeleuze removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 13, 2025
@sdeleuze sdeleuze modified the milestones: 7.0.0-RC1, 7.0.x Oct 13, 2025
@dmitrysulman dmitrysulman force-pushed the rsocket-interface-coroutine branch from 255ef56 to 49d92ce Compare October 29, 2025 18:31
@sdeleuze sdeleuze modified the milestones: 7.0.x, 7.0.0-RC3 Oct 29, 2025
@dmitrysulman dmitrysulman force-pushed the rsocket-interface-coroutine branch from 49d92ce to 4918592 Compare October 29, 2025 21:09
@dmitrysulman dmitrysulman requested a review from sdeleuze October 29, 2025 21:10
sdeleuze pushed a commit to sdeleuze/spring-framework that referenced this pull request Oct 30, 2025
sdeleuze added a commit to sdeleuze/spring-framework that referenced this pull request Oct 30, 2025
sdeleuze pushed a commit to sdeleuze/spring-framework that referenced this pull request Oct 30, 2025
Copy link
Contributor

@sdeleuze sdeleuze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good, will refine and merge.

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) theme: kotlin An issue related to Kotlin support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RSocket Interfaces doesn't work with coroutines.

4 participants