[
https://issues.apache.org/jira/browse/CXF-6834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15197251#comment-15197251
]
james strachan commented on CXF-6834:
-------------------------------------
Those demos look good!
It'd be nice to create a really cut down simple demo with the most autowiring /
autodiscovery / autoconfiguration so it looks more comparable to Spring Boot
demos with MVC / RestTemplate; its then a little easier to compare CXF with
Jersey / MVC / RestTemplate etc.
I wonder on the client side, can we inject to client interface to avoid using
the explicit Factory method?
https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/client/SampleRestClientApplication.java#L31
it might be nice to use an annotation to specify the URI and injection point or
something.
{code}
@Autowire // or @Inject
@Service("http://localhost:8080/services/helloservice/")
private HelloService service;
{code}
then it feels a bit more spring-boot-ish with stuff being injected? We could
then let the URL thats used to create the service be configured via spring's
autoconfiguration stuff (e.g. so you can put it into the application.properties
to override this URL or use a CLI option or env var etc).
On the server side can we remove almost everything but the resource bean like
the Spring MVC version?
https://github.com/fabric8io/kubeflix/blob/master/examples/hello-world/hello-ribbon-springboot/src/main/java/io/fabric8/kubeflix/examples/hellospringbootribbon/HelloController.java#L25
then the user doesn't have to include stuff like this:
https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleScanRestApplication2.java#L47-L71
i.e. making that stuff auto-configuration that gets set by default if you don't
add that code explicitly to your app
> add support for CXF inside Spring Boot
> --------------------------------------
>
> Key: CXF-6834
> URL: https://issues.apache.org/jira/browse/CXF-6834
> Project: CXF
> Issue Type: Improvement
> Components: JAX-RS
> Reporter: james strachan
> Assignee: Sergey Beryozkin
> Fix For: 3.2.0
>
>
> right now spring boot has support for Jersey; it'd be great to integrate
> support for CXF too.
> e.g.
> *
> https://github.com/spring-projects/spring-boot/tree/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey
> *
> https://github.com/spring-projects/spring-boot/tree/master/spring-boot-starters/spring-boot-starter-jersey
> *
> https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-jersey
> *
> https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-jersey1
> mostly this is about submitting a PR against the spring-boot project; but it
> may require a few changes in CXF to be more spring/spring-boot ready or to
> work better with Spring Boot's auto configuration mechanism and tooling:
> *
> https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-auto-configuration.html
> *
> https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html
> Docs on creating auto configuration here:
> https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-auto-configuration.html
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)