Skip to content

Commit

Permalink
pushing new svcs stack to branch for rhmap paper reference
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyary committed Jul 28, 2017
1 parent 22b1c32 commit d6c8c6d
Show file tree
Hide file tree
Showing 150 changed files with 6,430 additions and 6,717 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/timing.properties
/swagger.json
217 changes: 217 additions & 0 deletions Admin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>

<groupId>com.redhat.refarch.microservices</groupId>
<artifactId>admin-service</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>com.redhat.refarch.ecom.Application</start-class>

<fabric8.version>2.2.170.redhat-000010</fabric8.version>
<groovy.version>2.4.11</groovy.version>
<groovy.eclipse.batch.version>2.4.3-01</groovy.eclipse.batch.version>
<groovy.eclipse.compiler.version>2.9.2-01</groovy.eclipse.compiler.version>
<gson.version>2.8.1</gson.version>
<java.target.version>1.8</java.target.version>
<json-simple.version>1.1.1</json-simple.version>
<http-client.version>4.5.3</http-client.version>
<spring-boot.version>1.5.3.RELEASE</spring-boot.version>
<spring-data.version>1.10.3.RELEASE</spring-data.version>

<fabric8.maven.plugin.version>3.1.80.redhat-000010</fabric8.maven.plugin.version>
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
</properties>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!-- abstraction to property value doesn't work -->
<version>1.5.3.RELEASE</version>
<relativePath/>
</parent>

<repositories>
<!-- explicitly defining central so some build latency is removed on OCP -->
<repository>
<id>localrepository</id>
<url>file:///tmp/artifacts/m2</url>
</repository>
</repositories>
<pluginRepositories>
<!-- explicitly defining central so some build latency is removed on OCP -->
<pluginRepository>
<id>localrepository</id>
<url>file:///tmp/artifacts/m2</url>
</pluginRepository>
</pluginRepositories>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-project-bom-camel-spring-boot</artifactId>
<version>${fabric8.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>

<!-- POGO Models -->
<dependency>
<groupId>com.redhat.refarch.microservices</groupId>
<artifactId>model</artifactId>
<version>1.0</version>
</dependency>

<!-- Enabling health checks -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>

<!-- ActiveMQ -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
</dependency>

<!-- Camel -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-javaconfig</artifactId>
</dependency>


<!-- ws.rs -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
</dependency>

<!-- Groovy -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy.version}</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${http-client.version}</version>
</dependency>

</dependencies>

<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>

<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.target.version}</source>
<target>${java.target.version}</target>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>${groovy.eclipse.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>${groovy.eclipse.batch.version}</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${fabric8.maven.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>resource</goal>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<inherited>true</inherited>
<configuration>
<excludes>
<exclude>**/*KT.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
15 changes: 15 additions & 0 deletions Admin/src/main/fabric8/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
spec:
template:
spec:
containers:
-
resources:
requests:
cpu: "0.2"
# memory: 256Mi
limits:
cpu: "1.0"
# memory: 256Mi
env:
- name: ACTIVEMQ_SERVICE_NAME
value: broker-amq-tcp
38 changes: 38 additions & 0 deletions Admin/src/main/java/com/redhat/refarch/ecom/AppRoute.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Copyright 2005-2017 Red Hat, Inc.
* <p>
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License") you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.redhat.refarch.ecom

import com.redhat.refarch.ecom.service.AdminService
import org.apache.camel.spring.SpringRouteBuilder
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component

@Component
class AppRoute extends SpringRouteBuilder {

@Autowired
AdminService adminService

@Override
void configure() throws Exception {

from("amq:admin.reset")
.bean(adminService, "resetData")

from("amq:admin.testApi")
.bean(adminService, "testApi")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2005-2017 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* 2.0 (the "License") you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -13,21 +13,20 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.redhat.refarch.microservices.billing;
package com.redhat.refarch.ecom

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.context.annotation.ImportResource

/**
* The Spring-boot main class.
*/
@SpringBootApplication
@ImportResource({"classpath:spring/amq.xml"})
public class Application {
@ImportResource(["classpath:spring/amq.xml"])
class Application {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
static void main(String[] args) {
SpringApplication.run(Application.class, args)
}

}
45 changes: 45 additions & 0 deletions Admin/src/main/java/com/redhat/refarch/ecom/CamelConfig.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2005-2017 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License") you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.redhat.refarch.ecom

import org.apache.camel.CamelContext
import org.apache.camel.spring.boot.CamelContextConfiguration
import org.apache.camel.spring.javaconfig.CamelConfiguration
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration

/***
* @author [email protected]
*/
@Configuration
@ComponentScan("com.redhat.refarch.ecom.admin")
class CamelConfig extends CamelConfiguration {

@Bean
CamelContextConfiguration contextConfiguration() {
return new CamelContextConfiguration() {

@Override
void beforeApplicationStart(CamelContext context) {
context.setTracing(true)
}

@Override
void afterApplicationStart(CamelContext context) {}
}
}
}
Loading

0 comments on commit d6c8c6d

Please sign in to comment.