Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F3696200B56 for ; Sat, 30 Jul 2016 15:47:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E6CD6160A8A; Sat, 30 Jul 2016 13:47:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E0531160A63 for ; Sat, 30 Jul 2016 15:47:40 +0200 (CEST) Received: (qmail 8898 invoked by uid 500); 30 Jul 2016 13:47:40 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 8889 invoked by uid 99); 30 Jul 2016 13:47:40 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jul 2016 13:47:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id ADE711A5D92 for ; Sat, 30 Jul 2016 13:47:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id qxKbGD4SnAem for ; Sat, 30 Jul 2016 13:47:37 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id CD65D5FBF0 for ; Sat, 30 Jul 2016 13:47:36 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id EF818E0098 for ; Sat, 30 Jul 2016 13:47:35 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 134993A0046 for ; Sat, 30 Jul 2016 13:47:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r994108 - in /websites/production/cxf/content: cache/docs.pageCache docs/jaxrsclientspringboot.html docs/springboot.html Date: Sat, 30 Jul 2016 13:47:34 -0000 To: commits@cxf.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160730134735.134993A0046@svn01-us-west.apache.org> archived-at: Sat, 30 Jul 2016 13:47:42 -0000 Author: buildbot Date: Sat Jul 30 13:47:34 2016 New Revision: 994108 Log: Production update by buildbot for cxf Modified: websites/production/cxf/content/cache/docs.pageCache websites/production/cxf/content/docs/jaxrsclientspringboot.html websites/production/cxf/content/docs/springboot.html Modified: websites/production/cxf/content/cache/docs.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/cxf/content/docs/jaxrsclientspringboot.html ============================================================================== --- websites/production/cxf/content/docs/jaxrsclientspringboot.html (original) +++ websites/production/cxf/content/docs/jaxrsclientspringboot.html Sat Jul 30 13:47:34 2016 @@ -118,12 +118,12 @@ Apache CXF -- JAXRSClientSpringBoot

- +/*]]>*/

Introduction

This page describes how CXF JAX-RS Client code can be used inside SpringBoot applications.

Please see a CXF JAX-RS starter section on how to enable JAX-RS endpoints.

Setup

If your SpringBoot Application depends on a CXF JAX-RS starter then no more dependencies are required.

If you'd like to run JAX-RS clients in a pure client-side SpringBoot Application then the following Maven pom should suffice in many cases:

<?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" 
@@ -269,7 +269,7 @@ public class SpringBootClientApplication
         }
     }
 }
-

 

Configuration

The configuration properties apply to both WebClient and Proxy configurations.

cxf.jaxrs.client.address is a required property which identifies a target address.

cxf.jaxrs.client.thread-safe property can be set to true to make the clients thread-safe.

cxf.jaxrs.client.headers.accept property can be used to set HTTP Accept header.

cxf.jaxrs.client.headers.content-type property can be used to set HTTP Content-Type header.

cxf.jaxrs.client.classes-scan-packages property can be used to auto-discover JAX-RS service class interfaces (for proxies) and providers for proxies and web clients.

+

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.

cxf.jaxrs.client.address is a required property which identifies a target address.

cxf.jaxrs.client.thread-safe property can be set to true to make the clients thread-safe.

cxf.jaxrs.client.headers.accept property can be used to set HTTP Accept he ader.

cxf.jaxrs.client.headers.content-type property can be used to set HTTP Content-Type header.

cxf.jaxrs.client.classes-scan-packages property can be used to auto-discover JAX-RS service class interfaces (for proxies) and providers for proxies and web clients.

Modified: websites/production/cxf/content/docs/springboot.html ============================================================================== --- websites/production/cxf/content/docs/springboot.html (original) +++ websites/production/cxf/content/docs/springboot.html Sat Jul 30 13:47:34 2016 @@ -119,15 +119,17 @@ Apache CXF -- SpringBoot

Additional Configuration

Use "cxf.path" property to customize a CXFServlet URL pattern.

JAX-RS root resources and providers annotated with JAX-RS @Path and @Provider and native CXF Providers annotated with CXF @Provider can be auto-discovered.

Use "cxf.jaxrs.component-scan" property to create a JAX-RS endpoint from the auto-discovered JAX-RS root resources and providers which are marked as Spring Components (annotated with Spring @Component or created and returned from @Bean methods).

Use "cxf.jaxrs.classes-scan" property to create a JAX-RS endpoint from the auto-discovered JAX-RS root resources and provider classes. Such classes do not have to be annotated with Spring @Compo nent. This property needs to be accompanied by a "cxf.jaxrs.classes-scan-packages" property which sets a comma-separated list of the packages to scan.

Note that while "cxf.jaxrs.component-scan" and "cxf.jaxrs.classes-scan" are mutually exclusive, "cxf.jaxrs.component-scan" can be used alongside the "cxf.jaxrs.classes-scan-packages" property to enable the auto-discovery of the JAX-RS resources and providers which may or may not be marked as Spring Components.

API Documentation

Swagger

See CXF Swagger2Feature documentation on how to enable Swagger2Feature in SpringBoot and how to auto-activate Swagger UI.

WADL

CXF automatically loads a WADL provider if a cxf-rt-rs-service-description module is available on the runtime classpath.

Service Registry Publication

Publication of JAX-RS endpoints into well-known service registries such as Netflix Eureka Registry is shown in a JAX-RS Spring Boot Scan demo.

Examples

Manual Configuration

Consider the following Configuration instance:

JAX-RS Configuration
+

Additional Configuration

Use "cxf.path" property to customize a CXFServlet URL pattern.

JAX-RS root resources and providers annotated with JAX-RS @Path and @Provider and native CXF Providers annotated with CXF @Provider can be auto-discovered.

Use "cxf.jaxrs.component-scan" property to create a JAX-RS endpoint from the auto-discovered JAX-RS root resources and providers which are marked as Spring Components (annotated with Spring @Component or created and returned from @Bean methods).

Use "cxf.jaxrs.classes-scan" property to create a JAX-RS endpoint from the auto-discovered JAX-RS root resources and provider classes. Such classes do not have to be annotated with Spring @Compo nent. This property needs to be accompanied by a "cxf.jaxrs.classes-scan-packages" property which sets a comma-separated list of the packages to scan.

Note that while "cxf.jaxrs.component-scan" and "cxf.jaxrs.classes-scan" are mutually exclusive, "cxf.jaxrs.component-scan" can be used alongside the "cxf.jaxrs.classes-scan-packages" property to enable the auto-discovery of the JAX-RS resources and providers which may or may not be marked as Spring Components.

API Documentation

Swagger

See CXF Swagger2Feature documentation on how to enable Swagger2Feature in SpringBoot and how to auto-activate Swagger UI.

WADL

CXF automatically loads a WADL provider if a cxf-rt-rs-service-description module is available on the runtime classpath.

Service Registry Publication

Publication of JAX-RS endpoints into well-known service registries such as Netflix Eureka Registry is shown in a JAX-RS Spring Boot Scan demo.

Examples

Manual Configuration

Consider the following Configuration instance:

JAX-RS Configuration
package sample.rs.service;
 import java.util.Arrays;