Skip to content

Conversation

@tzolov
Copy link
Collaborator

@tzolov tzolov commented Oct 2, 2025

  • Add filterNonReactiveReturnTypeMethod() and filterReactiveReturnTypeMethod() to McpProviderUtils for consistent return type validation
  • Add logging to warn when methods with incompatible return types are skipped
  • Replace inline return type checks across all provider classes with utility methods
  • Standardize import organization (group by external/internal packages)
  • Update tests to reflect filtering of non-reactive methods in async providers

This refactoring improves code maintainability by centralizing the logic for determining whether a method has a reactive or non-reactive return type, and provides better visibility through logging when methods are filtered out.

Affected providers:

  • Complete (Async/Sync, Stateless/Stateful)
  • Elicitation (Async/Sync)
  • Logging (Async/Sync)
  • Progress (Async/Sync)
  • Prompt (Async/Sync, Stateless/Stateful)
  • Resource (Async/Sync, Stateless/Stateful)
  • Sampling (Async/Sync)
  • Tool (Async/Sync, Stateless/Stateful)
  • Changed listeners (Prompt/Resource/Tool, Async/Sync)

Related to spring-projects/spring-ai#4392

…y methods

- Add filterNonReactiveReturnTypeMethod() and filterReactiveReturnTypeMethod()
  to McpProviderUtils for consistent return type validation
- Add logging to warn when methods with incompatible return types are skipped
- Replace inline return type checks across all provider classes with utility methods
- Standardize import organization (group by external/internal packages)
- Update tests to reflect filtering of non-reactive methods in async providers

This refactoring improves code maintainability by centralizing the logic for
determining whether a method has a reactive or non-reactive return type, and
provides better visibility through logging when methods are filtered out.

Affected providers:
- Complete (Async/Sync, Stateless/Stateful)
- Elicitation (Async/Sync)
- Logging (Async/Sync)
- Progress (Async/Sync)
- Prompt (Async/Sync, Stateless/Stateful)
- Resource (Async/Sync, Stateless/Stateful)
- Sampling (Async/Sync)
- Tool (Async/Sync, Stateless/Stateful)
- Changed listeners (Prompt/Resource/Tool, Async/Sync)

Signed-off-by: Christian Tzolov <[email protected]>
@tzolov tzolov added this to the 0.6.0 milestone Oct 2, 2025
@tzolov
Copy link
Collaborator Author

tzolov commented Oct 2, 2025

To back port to 0.5.1

@tzolov tzolov merged commit 1176e6b into spring-ai-community:main Oct 2, 2025
1 check passed
tzolov added a commit that referenced this pull request Oct 2, 2025
…y methods (#66)

- Add filterNonReactiveReturnTypeMethod() and filterReactiveReturnTypeMethod()
  to McpProviderUtils for consistent return type validation
- Add logging to warn when methods with incompatible return types are skipped
- Replace inline return type checks across all provider classes with utility methods
- Standardize import organization (group by external/internal packages)
- Update tests to reflect filtering of non-reactive methods in async providers

This refactoring improves code maintainability by centralizing the logic for
determining whether a method has a reactive or non-reactive return type, and
provides better visibility through logging when methods are filtered out.

Affected providers:
- Complete (Async/Sync, Stateless/Stateful)
- Elicitation (Async/Sync)
- Logging (Async/Sync)
- Progress (Async/Sync)
- Prompt (Async/Sync, Stateless/Stateful)
- Resource (Async/Sync, Stateless/Stateful)
- Sampling (Async/Sync)
- Tool (Async/Sync, Stateless/Stateful)
- Changed listeners (Prompt/Resource/Tool, Async/Sync)

Signed-off-by: Christian Tzolov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant