Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
1,031 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>customerOrderService</artifactId> | ||
<name> + customerOrderService</name> | ||
<packaging>jar</packaging> | ||
|
||
<parent> | ||
<groupId>org.ff4j.samples</groupId> | ||
<artifactId>demo-voxxeddays</artifactId> | ||
<version>1.7.1</version> | ||
</parent> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.ff4j</groupId> | ||
<artifactId>ff4j-store-consul</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-consul-all</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-thymeleaf</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.webjars</groupId> | ||
<artifactId>bootstrap</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-devtools</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
18 changes: 18 additions & 0 deletions
18
...-ticino-2018/customerOrderService/src/main/java/org/ff4j/voxxeddays/CustomerOrderApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.ff4j.voxxeddays; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | ||
|
||
/** | ||
* Customer Services. | ||
*/ | ||
@SpringBootApplication | ||
@EnableDiscoveryClient | ||
public class CustomerOrderApp { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(CustomerOrderApp.class, args); | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
...s-ticino-2018/customerOrderService/src/main/java/org/ff4j/voxxeddays/conf/FF4jConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.ff4j.voxxeddays.conf; | ||
|
||
import org.ff4j.FF4j; | ||
import org.ff4j.audit.repository.InMemoryEventRepository; | ||
import org.ff4j.consul.ConsulConnection; | ||
import org.ff4j.consul.store.FeatureStoreConsul; | ||
import org.ff4j.consul.store.PropertyStoreConsul; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import com.orbitz.consul.Consul; | ||
|
||
@Configuration | ||
public class FF4jConfig { | ||
|
||
@Value("${spring.cloud.consul.host:localhost}") | ||
private String consulHost; | ||
|
||
@Value("${spring.cloud.consul.port:5000}") | ||
private int consulPort; | ||
|
||
@Bean | ||
public Consul consul() { | ||
return Consul.builder().withUrl("http://" + consulHost + ":" + consulPort).build(); | ||
} | ||
|
||
@Bean | ||
public FF4j ff4j(Consul c) { | ||
FF4j ff4j = new FF4j().audit(true).autoCreate(true); | ||
ConsulConnection connection = new ConsulConnection(c); | ||
ff4j.setFeatureStore(new FeatureStoreConsul(connection)); | ||
ff4j.setPropertiesStore(new PropertyStoreConsul(connection)); | ||
ff4j.setEventRepository(new InMemoryEventRepository()); | ||
return ff4j; | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...018/customerOrderService/src/main/java/org/ff4j/voxxeddays/controller/HomeController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.ff4j.voxxeddays.controller; | ||
|
||
import java.util.Map; | ||
|
||
import org.ff4j.FF4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
public class HomeController { | ||
|
||
@Autowired | ||
private FF4j ff4j; | ||
|
||
@RequestMapping("/") | ||
public String welcome(Map<String, Object> model) { | ||
model.put("message", "OK"); | ||
model.put("ff4j_feature_TEST", ff4j.check("TEST")); | ||
|
||
return "welcome"; | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
ff4j-voxxeddays-ticino-2018/customerOrderService/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# --------------------------------------------------- # | ||
# --- Customer Order Service --- # | ||
# --------------------------------------------------- # | ||
|
||
# Define Server Port | ||
server.port=8081 | ||
server.contextPath=/customerOrder | ||
|
||
# General Informations | ||
spring.application.name=Customer Order Service | ||
|
||
# Consul | ||
spring.cloud.consul.host=localhost | ||
spring.cloud.consul.port=8500 | ||
spring.cloud.consul.discovery.tags=name=customerOrder | ||
spring.cloud.consul.discovery.healthCheckPath=/customerOrder/health | ||
spring.cloud.consul.discovery.healthCheckInterval=15s | ||
|
7 changes: 7 additions & 0 deletions
7
ff4j-voxxeddays-ticino-2018/customerOrderService/src/main/resources/static/css/main.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
h1{ | ||
color:#0000FF; | ||
} | ||
|
||
h2{ | ||
color:#FF0000; | ||
} |
36 changes: 36 additions & 0 deletions
36
ff4j-voxxeddays-ticino-2018/customerOrderService/src/main/resources/templates/welcome.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE HTML> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
|
||
<head> | ||
<title>Customer Order Service</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<link rel="stylesheet" type="text/css" href="webjars/bootstrap/3.3.7/css/bootstrap.min.css" /> | ||
<link rel="stylesheet" th:href="@{/css/main.css}" href="../../css/main.css" /> | ||
</head> | ||
<body> | ||
|
||
<nav class="navbar navbar-inverse"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<a class="navbar-brand" href="#">Customer Order Service</a> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<div class="container"> | ||
|
||
<div class="starter-template"> | ||
<h1> Customer Order Service </h1> | ||
<li><span th:text="'Message: ' + ${message}"></span></li> | ||
<li><span th:text="'Message: ' + ${ff4j_feature_TEST}"></span></li> | ||
|
||
</div> | ||
|
||
</div> | ||
<!-- /.container --> | ||
|
||
<script type="text/javascript" | ||
src="webjars/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
|
||
</body> | ||
</html> |
47 changes: 47 additions & 0 deletions
47
ff4j-voxxeddays-ticino-2018/customerSupportService/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>customerSupportService</artifactId> | ||
<name> + customerSupportService</name> | ||
<packaging>jar</packaging> | ||
|
||
<parent> | ||
<groupId>org.ff4j.samples</groupId> | ||
<artifactId>demo-voxxeddays</artifactId> | ||
<version>1.7.1</version> | ||
</parent> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.ff4j</groupId> | ||
<artifactId>ff4j-store-consul</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-consul-all</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-thymeleaf</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.webjars</groupId> | ||
<artifactId>bootstrap</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-devtools</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
18 changes: 18 additions & 0 deletions
18
...ino-2018/customerSupportService/src/main/java/org/ff4j/voxxeddays/CustomerSupportApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.ff4j.voxxeddays; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | ||
|
||
/** | ||
* Customer Services. | ||
*/ | ||
@SpringBootApplication | ||
@EnableDiscoveryClient | ||
public class CustomerSupportApp { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(CustomerSupportApp.class, args); | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
...ticino-2018/customerSupportService/src/main/java/org/ff4j/voxxeddays/conf/FF4jConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.ff4j.voxxeddays.conf; | ||
|
||
import org.ff4j.FF4j; | ||
import org.ff4j.audit.repository.InMemoryEventRepository; | ||
import org.ff4j.consul.ConsulConnection; | ||
import org.ff4j.consul.store.FeatureStoreConsul; | ||
import org.ff4j.consul.store.PropertyStoreConsul; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import com.orbitz.consul.Consul; | ||
|
||
@Configuration | ||
public class FF4jConfig { | ||
|
||
@Value("${spring.cloud.consul.host:localhost}") | ||
private String consulHost; | ||
|
||
@Value("${spring.cloud.consul.port:5000}") | ||
private int consulPort; | ||
|
||
@Bean | ||
public Consul consul() { | ||
return Consul.builder().withUrl("http://" + consulHost + ":" + consulPort).build(); | ||
} | ||
|
||
@Bean | ||
public FF4j ff4j(Consul c) { | ||
FF4j ff4j = new FF4j().audit(true).autoCreate(true); | ||
ConsulConnection connection = new ConsulConnection(c); | ||
ff4j.setFeatureStore(new FeatureStoreConsul(connection)); | ||
ff4j.setPropertiesStore(new PropertyStoreConsul(connection)); | ||
ff4j.setEventRepository(new InMemoryEventRepository()); | ||
return ff4j; | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...8/customerSupportService/src/main/java/org/ff4j/voxxeddays/controller/HomeController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.ff4j.voxxeddays.controller; | ||
|
||
import java.util.Map; | ||
|
||
import org.ff4j.FF4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
public class HomeController { | ||
|
||
@Autowired | ||
private FF4j ff4j; | ||
|
||
@RequestMapping("/") | ||
public String welcome(Map<String, Object> model) { | ||
model.put("message", "OK"); | ||
model.put("ff4j_feature_TEST", ff4j.check("TEST")); | ||
|
||
return "welcome"; | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
ff4j-voxxeddays-ticino-2018/customerSupportService/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# --------------------------------------------------- # | ||
# --- Customer Order Service --- # | ||
# --------------------------------------------------- # | ||
|
||
# Define Server Port | ||
server.port=8082 | ||
server.contextPath=/customerSupport | ||
|
||
# General Informations | ||
spring.application.name=Customer Support Service | ||
|
||
# Consul | ||
spring.cloud.consul.host=localhost | ||
spring.cloud.consul.port=8500 | ||
spring.cloud.consul.discovery.tags=name=customerSupport | ||
spring.cloud.consul.discovery.healthCheckPath=/customerSupport/health | ||
spring.cloud.consul.discovery.healthCheckInterval=15s | ||
|
7 changes: 7 additions & 0 deletions
7
ff4j-voxxeddays-ticino-2018/customerSupportService/src/main/resources/static/css/main.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
h1{ | ||
color:#0000FF; | ||
} | ||
|
||
h2{ | ||
color:#FF0000; | ||
} |
36 changes: 36 additions & 0 deletions
36
ff4j-voxxeddays-ticino-2018/customerSupportService/src/main/resources/templates/welcome.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE HTML> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
|
||
<head> | ||
<title>Customer Order Service</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<link rel="stylesheet" type="text/css" href="webjars/bootstrap/3.3.7/css/bootstrap.min.css" /> | ||
<link rel="stylesheet" th:href="@{/css/main.css}" href="../../css/main.css" /> | ||
</head> | ||
<body> | ||
|
||
<nav class="navbar navbar-inverse" style="background-color:#000088"> | ||
<div class="container"> | ||
<div class="navbar-header" > | ||
<a class="navbar-brand" href="#">Support Service</a> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<div class="container"> | ||
|
||
<div class="starter-template"> | ||
<h1> Customer Order Service </h1> | ||
<li><span th:text="'Message: ' + ${message}"></span></li> | ||
<li><span th:text="'Message: ' + ${ff4j_feature_TEST}"></span></li> | ||
|
||
</div> | ||
|
||
</div> | ||
<!-- /.container --> | ||
|
||
<script type="text/javascript" | ||
src="webjars/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
|
||
</body> | ||
</html> |
Binary file not shown.
Oops, something went wrong.