THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||
---|---|---|
| ||
package sample.rs.client; import org.apache.cxf.jaxrs.client.spring.JaxRsProxyClientConfiguration; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import sample.rs.service.HelloService; @SpringBootApplication public class SpringBootClientApplication { public static void main(String[] args) { SpringApplication.run(SpringBootClientApplication.class, args); } @Bean CommandLineRunner initProxyClientRunner(final HelloService client) { return new CommandLineRunner() { @Override public void run(String... runArgs) throws Exception { System.out.println(client.sayHello("ApacheCxfProxyUser")); } }; } @Configuration static class HeloServiceConfiguration extends JaxRsProxyClientConfiguration { @Override protected Class<?> getServiceClass() { return HelloService.class; } } } |
Discovery of Service Endpoints
Discovery of JAX-RS endpoint addresses published to a well-known service registries such as Netflix Eureka Registry is shown in a JAX-RS Spring Boot Scan demo.
This is achieved with the help of CXF Failover and/or LoadBalancing features.
Configuration
The configuration properties apply to both WebClient and Proxy configurations.
...