Skip to content

Conversation

@philwebb
Copy link
Member

@philwebb philwebb commented Sep 9, 2025

This pull-request provides a number of possible refinements to interface client support, primarily to help with Spring Boot support.

The following commits are included:

  • Make AbstractHttpServiceRegistrar.findHttpServices(...) protected
  • Support convention based @ImportHttpServices imports
  • Add ImportHttpServices.GroupProvider support
  • Make ImportHttpServiceRegistrar public

Make the `AbstractHttpServiceRegistrar.findHttpServices(...)` a
protected method so that subclasses can use it to find bean definitions.

The method was made `private` in commit 736383e, but is still useful
even with the removal of `@HttpClientService`.

See spring-projectsgh-35447
Update `@ImportHttpServices` to support convention based imports when
neither types or base packages are specified. This update allows
`@ImportHttpServices` to work in a similar way to `@ComponentScan`
where the annotation alone is enough to find HTTP interface clients.

For example:

	package com.example;

	@configuration
	@ImportHttpServices(group = "test")
	static class MyConfig {
		// this config scans for interface clients in `com.example`
	}

See spring-projectsgh-35447
Update `@ImportHttpServices` to allow the group to either be specified
using the `group` attribute or a `groupProvider` implementation.

Using a `groupProvider` allows the group name to be deduced from the
class metadata. For example, users could use a custom annotation
to hold the group name.

Groups must either be specified using the `group` attribute *or* the
`groupProvider` attribute. Attempting to set both will cause an
`IllegalStateException` to be thrown.

See spring-projectsgh-35447
Make `ImportHttpServiceRegistrar` a public class and also allow
subclasses to call `registerHttpServices(...)`.

This update allows Spring Boot to reuse `ImportHttpServiceRegistrar`
for convention based auto-configuration.

See spring-projectsgh-35447
@philwebb philwebb force-pushed the interface-client-refinements branch from c5776c0 to f3b3192 Compare September 9, 2025 05:50
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 9, 2025
@philwebb
Copy link
Member Author

philwebb commented Sep 9, 2025

Closing since we need more discussion time on these issues and they may need to wait until after Spring Framework 7.0 at this point.

@philwebb philwebb closed this Sep 9, 2025
@bclozel bclozel removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 9, 2025
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.

3 participants