-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
rest-http-interface example code can't run #34443
Comments
@Fabriceli I can't reproduce with a simple app, could you please share a reproducer? |
Reproducer include 4 files:
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@Slf4j
@SpringBootApplication
public class Demo {
public static void main(String[] args) {
SpringApplication application = new SpringApplication(Demo20250211.class);
application.run(args);
}
}
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.support.WebClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
@Slf4j
@RestController
public class DemoController {
@GetMapping("/proxy")
public String proxy(){
WebClient webClient = WebClient.builder().baseUrl("http://httpbin.org").build();
WebClientAdapter adapter = WebClientAdapter.create(webClient);
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(adapter).build();
Httpbin service = factory.createClient(Httpbin.class);
return service.getIp();
}
}
import org.springframework.web.service.annotation.GetExchange;
interface Httpbin {
@GetExchange("/ip")
String getIp();
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
} If it can reproducer, could you assign it to me to fix? |
Since this has been created as an issue and is a simple change I had already locally, I pushed it myself. Next time, feel free to directly create a PR instead of an issue. |
Closes spring-projectsgh-34443 Signed-off-by: Vincent Potucek <vincent.potucek@sap.com>
Base info:
Reproduce steps:
Solution
Adding 'public' before an interface class
The text was updated successfully, but these errors were encountered: