cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Updating SpringBoot scan demo to use the registry and actuator endpoints
Date Fri, 24 Jun 2016 16:14:14 GMT
Repository: cxf
Updated Branches:
  refs/heads/master cbfb1bd72 -> 16e6cee81


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/16e6cee8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/16e6cee8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/16e6cee8

Branch: refs/heads/master
Commit: 16e6cee818783c4a6703dcaa9c07a81cf9e26eed
Parents: cbfb1bd
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri Jun 24 17:13:59 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri Jun 24 17:13:59 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/16e6cee8/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 03ef90a..cbf835c 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/16e6cee8/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/16e6cee8/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/16e6cee8/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/16e6cee8/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


Mime
View raw message