Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 12b8e711d -> a8787e71d
Updating SpringBoot scan demo to use the registry and actuator endpoints Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a8787e71 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a8787e71 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a8787e71 Branch: refs/heads/3.1.x-fixes Commit: a8787e71d799bedbeb697c5f86422201c8d429fe Parents: 12b8e71 Author: Sergey Beryozkin <[email protected]> Authored: Fri Jun 24 17:13:59 2016 +0100 Committer: Sergey Beryozkin <[email protected]> Committed: Fri Jun 24 17:16:26 2016 +0100 ---------------------------------------------------------------------- .../jax_rs/jaxrs_spring_boot_scan/pom.xml | 13 ++++++++ .../rs/service/SampleScanRestApplication.java | 32 +++++++++++++++++++- .../src/main/resources/application.properties | 3 -- .../src/main/resources/application.yml | 21 +++++++++++++ .../src/main/resources/bootstrap.yml | 3 ++ 5 files changed, 68 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/a8787e71/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/pom.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/pom.xml b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/pom.xml index 32e88f0..410003d 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/pom.xml +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/pom.xml @@ -26,6 +26,19 @@ <artifactId>cxf-rt-rs-service-description</artifactId> <version>${cxf.version}</version> </dependency> + <!-- Eureka Service Discovery Client --> + <dependency> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-starter-eureka</artifactId> + <version>1.0.0.RELEASE</version> + </dependency> + <!-- Actuator Endpoints --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-actuator</artifactId> + <version>1.3.5.RELEASE</version> + </dependency> + <dependency> <groupId>io.swagger</groupId> <artifactId>swagger-jaxrs</artifactId> http://git-wip-us.apache.org/repos/asf/cxf/blob/a8787e71/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java index a839659..68db191 100644 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/java/sample/rs/service/SampleScanRestApplication.java @@ -19,11 +19,17 @@ package sample.rs.service; import org.apache.cxf.jaxrs.swagger.Swagger2Feature; import org.springframework.boot.SpringApplication; +import org.springframework.boot.actuate.autoconfigure.ExportMetricWriter; +import org.springframework.boot.actuate.metrics.Metric; +import org.springframework.boot.actuate.metrics.writer.Delta; +import org.springframework.boot.actuate.metrics.writer.MetricWriter; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; @SpringBootApplication +@EnableEurekaClient public class SampleScanRestApplication { public static void main(String[] args) { SpringApplication.run(SampleScanRestApplication.class, args); @@ -33,5 +39,29 @@ public class SampleScanRestApplication { public Swagger2Feature swaggerFeature(ApplicationContext context) { return new Swagger2Feature(); } - + @Bean + @ExportMetricWriter + public MetricWriter metricWriter() { + return new MetricWriter() { + + @Override + public void set(Metric<?> arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void increment(Delta<?> arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void reset(String arg0) { + // TODO Auto-generated method stub + + } + + }; + } } http://git-wip-us.apache.org/repos/asf/cxf/blob/a8787e71/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.properties ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.properties b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.properties deleted file mode 100644 index 091a7ac..0000000 --- a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -cxf.path=/services/helloservice -cxf.jaxrs.component-scan=true - http://git-wip-us.apache.org/repos/asf/cxf/blob/a8787e71/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.yml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.yml b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.yml new file mode 100644 index 0000000..9781013 --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/application.yml @@ -0,0 +1,21 @@ +server: + port: ${vcap.application.port:8080} + servlet-path: /system + +cxf: + path: /services/helloservice + jaxrs: + component-scan: true + +eureka: + client: + serviceUrl: + defaultZone: ${vcap.services.eureka-service.credentials.uri:http://127.0.0.1:8761}/eureka/ + instance: + statusPageUrlPath: /system/info + healthCheckUrlPath: /system/health + +--- +spring: + profiles: cloud + http://git-wip-us.apache.org/repos/asf/cxf/blob/a8787e71/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/bootstrap.yml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/bootstrap.yml b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..64c10bc --- /dev/null +++ b/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot_scan/src/main/resources/bootstrap.yml @@ -0,0 +1,3 @@ +spring: + application: + name: jaxrs-hello-world-service
