Upgraded to work with the Eventuate client framework version 0.12
See http://eventuate.io/docs/java/spring-configuration.html for details on new configuration properties. Upgraded to Spring Boot 1.2.8 Misc changes to build scripts
This commit is contained in:
@@ -66,13 +66,16 @@ See this [wiki page](../../wiki/AboutTheEventStoreServer) for more details.
|
|||||||
|
|
||||||
# Building the application (and running the tests)
|
# Building the application (and running the tests)
|
||||||
|
|
||||||
Both projects use Gradle.
|
Both versions of the application use Gradle.
|
||||||
To build a project, execute this command:
|
To build an application, execute this command in the application's top-level directory:
|
||||||
|
|
||||||
```
|
```
|
||||||
./gradlew assemble
|
./gradlew assemble
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: you do not need to install Gradle.
|
||||||
|
It will be automatically downloaded by `./gradlew`.
|
||||||
|
|
||||||
This will build a Spring Boot jar in each of the `*-service` directories.
|
This will build a Spring Boot jar in each of the `*-service` directories.
|
||||||
|
|
||||||
You can also run the tests using `gradle build`.
|
You can also run the tests using `gradle build`.
|
||||||
|
|||||||
41
_build-and-test-all.sh
Executable file
41
_build-and-test-all.sh
Executable file
@@ -0,0 +1,41 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
DOCKER_COMPOSE="docker-compose -p event-sourcing-examples"
|
||||||
|
|
||||||
|
if [ "$1" = "--use-existing" ] ; then
|
||||||
|
shift;
|
||||||
|
else
|
||||||
|
${DOCKER_COMPOSE?} stop
|
||||||
|
${DOCKER_COMPOSE?} rm -v --force
|
||||||
|
fi
|
||||||
|
|
||||||
|
${DOCKER_COMPOSE?} up -d mongodb
|
||||||
|
|
||||||
|
if [ -z "$DOCKER_HOST_IP" ] ; then
|
||||||
|
export DOCKER_HOST_IP=$(docker-machine ip default)
|
||||||
|
echo set DOCKER_HOST_IP $DOCKER_HOST_IP
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$SPRING_DATA_MONGODB_URI" ] ; then
|
||||||
|
export SPRING_DATA_MONGODB_URI=mongodb://${DOCKER_HOST_IP}/mydb
|
||||||
|
echo Set SPRING_DATA_MONGODB_URI $SPRING_DATA_MONGODB_URI
|
||||||
|
fi
|
||||||
|
|
||||||
|
export SERVICE_HOST=$DOCKER_HOST_IP
|
||||||
|
|
||||||
|
./gradlew $* build
|
||||||
|
|
||||||
|
${DOCKER_COMPOSE?} up -d
|
||||||
|
|
||||||
|
$DIR/wait-for-services.sh $DOCKER_HOST_IP
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
./gradlew $* :e2e-test:cleanTest :e2e-test:test
|
||||||
|
|
||||||
|
${DOCKER_COMPOSE?} stop
|
||||||
|
${DOCKER_COMPOSE?} rm -v --force
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
mongodb:
|
|
||||||
image: dockerfile/mongodb
|
|
||||||
ports:
|
|
||||||
- "27017:27017"
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
docker run --link esexamplesdocker_mongodb_1:mongodb -i -t dockerfile/mongodb:latest /usr/bin/mongo --host mongodb
|
|
||||||
|
|
||||||
@@ -3,16 +3,12 @@ apply plugin: 'java'
|
|||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
compile project(":common-backend")
|
compile project(":common-backend")
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
|
|
||||||
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.3'
|
|
||||||
compile 'com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.3'
|
|
||||||
|
|
||||||
testCompile project(":testutil")
|
testCompile project(":testutil")
|
||||||
testCompile "junit:junit:4.11"
|
testCompile "junit:junit:4.11"
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
||||||
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ dependencies {
|
|||||||
compile "org.springframework.boot:spring-boot-starter-web"
|
compile "org.springframework.boot:spring-boot-starter-web"
|
||||||
compile "org.springframework.boot:spring-boot-starter-actuator"
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apply plugin: 'java'
|
|||||||
dependencies {
|
dependencies {
|
||||||
compile project(":common-backend")
|
compile project(":common-backend")
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
|
||||||
compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion"
|
compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion"
|
||||||
|
|
||||||
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
|
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
|
||||||
@@ -13,7 +13,7 @@ dependencies {
|
|||||||
testCompile project(":testutil")
|
testCompile project(":testutil")
|
||||||
testCompile "junit:junit:4.11"
|
testCompile "junit:junit:4.11"
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
||||||
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import net.chrisrichardson.eventstore.subscriptions.DispatchedEvent;
|
|||||||
import net.chrisrichardson.eventstore.subscriptions.EventHandlerMethod;
|
import net.chrisrichardson.eventstore.subscriptions.EventHandlerMethod;
|
||||||
import net.chrisrichardson.eventstore.subscriptions.EventSubscriber;
|
import net.chrisrichardson.eventstore.subscriptions.EventSubscriber;
|
||||||
import rx.Observable;
|
import rx.Observable;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
@@ -20,6 +22,8 @@ import static net.chrisrichardson.eventstore.javaexamples.banking.backend.querys
|
|||||||
@EventSubscriber(id="querySideEventHandlers")
|
@EventSubscriber(id="querySideEventHandlers")
|
||||||
public class AccountQueryWorkflow implements CompoundEventHandler {
|
public class AccountQueryWorkflow implements CompoundEventHandler {
|
||||||
|
|
||||||
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private AccountInfoUpdateService accountInfoUpdateService;
|
private AccountInfoUpdateService accountInfoUpdateService;
|
||||||
|
|
||||||
public AccountQueryWorkflow(AccountInfoUpdateService accountInfoUpdateService) {
|
public AccountQueryWorkflow(AccountInfoUpdateService accountInfoUpdateService) {
|
||||||
@@ -31,7 +35,7 @@ public class AccountQueryWorkflow implements CompoundEventHandler {
|
|||||||
AccountOpenedEvent event = de.event();
|
AccountOpenedEvent event = de.event();
|
||||||
String id = de.getEntityIdentifier().getId();
|
String id = de.getEntityIdentifier().getId();
|
||||||
String eventId = de.eventId().asString();
|
String eventId = de.eventId().asString();
|
||||||
System.out.println("**************** account version=" + id + ", " + eventId);
|
logger.info("**************** account version=" + id + ", " + eventId);
|
||||||
BigDecimal initialBalance = event.getInitialBalance();
|
BigDecimal initialBalance = event.getInitialBalance();
|
||||||
accountInfoUpdateService.create(id, initialBalance, eventId);
|
accountInfoUpdateService.create(id, initialBalance, eventId);
|
||||||
return Observable.just(null);
|
return Observable.just(null);
|
||||||
@@ -43,8 +47,8 @@ public class AccountQueryWorkflow implements CompoundEventHandler {
|
|||||||
String moneyTransferId = de.getEntityIdentifier().getId();
|
String moneyTransferId = de.getEntityIdentifier().getId();
|
||||||
String fromAccountId = de.event().getDetails().getFromAccountId().getId();
|
String fromAccountId = de.event().getDetails().getFromAccountId().getId();
|
||||||
String toAccountId = de.event().getDetails().getToAccountId().getId();
|
String toAccountId = de.event().getDetails().getToAccountId().getId();
|
||||||
System.out.println("**************** account version=" + fromAccountId + ", " + de.eventId().asString());
|
logger.info("**************** account version=" + fromAccountId + ", " + de.eventId().asString());
|
||||||
System.out.println("**************** account version=" + toAccountId + ", " + de.eventId().asString());
|
logger.info("**************** account version=" + toAccountId + ", " + de.eventId().asString());
|
||||||
|
|
||||||
AccountTransactionInfo ti = new AccountTransactionInfo(moneyTransferId, fromAccountId, toAccountId, toIntegerRepr(de.event().getDetails().getAmount()));
|
AccountTransactionInfo ti = new AccountTransactionInfo(moneyTransferId, fromAccountId, toAccountId, toIntegerRepr(de.event().getDetails().getAmount()));
|
||||||
|
|
||||||
@@ -74,7 +78,7 @@ public class AccountQueryWorkflow implements CompoundEventHandler {
|
|||||||
long balanceDelta = amount * delta;
|
long balanceDelta = amount * delta;
|
||||||
AccountChangeInfo ci = new AccountChangeInfo(changeId, transactionId, de.event().getClass().getSimpleName(), amount, balanceDelta);
|
AccountChangeInfo ci = new AccountChangeInfo(changeId, transactionId, de.event().getClass().getSimpleName(), amount, balanceDelta);
|
||||||
String accountId = de.getEntityIdentifier().getId();
|
String accountId = de.getEntityIdentifier().getId();
|
||||||
System.out.println("**************** account version=" + accountId + ", " + de.eventId().asString());
|
logger.info("**************** account version=" + accountId + ", " + de.eventId().asString());
|
||||||
|
|
||||||
accountInfoUpdateService.updateBalance(accountId, changeId, balanceDelta, ci);
|
accountInfoUpdateService.updateBalance(accountId, changeId, balanceDelta, ci);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ dependencies {
|
|||||||
compile "org.springframework.boot:spring-boot-starter-web"
|
compile "org.springframework.boot:spring-boot-starter-web"
|
||||||
compile "org.springframework.boot:spring-boot-starter-actuator"
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
testCompile project(":testutil")
|
testCompile project(":testutil")
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ dependencies {
|
|||||||
testCompile project(":testutil")
|
testCompile project(":testutil")
|
||||||
testCompile "junit:junit:4.11"
|
testCompile "junit:junit:4.11"
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
||||||
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
3
java-spring/build-and-test-all.sh
Executable file
3
java-spring/build-and-test-all.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
../_build-and-test-all.sh $*
|
||||||
@@ -22,13 +22,7 @@ subprojects {
|
|||||||
targetCompatibility = 1.7
|
targetCompatibility = 1.7
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
if (project.hasProperty("localMavenRepoUrl")) {
|
|
||||||
project.localMavenRepoUrl.split(',').each { theUrl ->
|
|
||||||
maven { url theUrl }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://06c59145-4e83-4f22-93ef-6a7eee7aebaa.repos.chrisrichardson.net.s3.amazonaws.com" }
|
eventuateMavenRepoUrl.split(',').each { repoUrl -> maven { url repoUrl } }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ class VerifyEventStoreEnvironmentPlugin implements Plugin<Project> {
|
|||||||
project.test {
|
project.test {
|
||||||
beforeSuite { x ->
|
beforeSuite { x ->
|
||||||
if (x.parent == null) {
|
if (x.parent == null) {
|
||||||
if (System.getenv("EVENT_STORE_URL") == null)
|
if (System.getenv("EVENTUATE_API_KEY_ID") == null && System.getenv("EVENTUATE_API_KEY_SECRET") == null)
|
||||||
logger.warn("\nPLEASE make sure that Event Store-related environment variables including EVENT_STORE_URL are set, see sample-set-remote-env.sh !!!!\n")
|
logger.warn("\nPLEASE make sure that Eventuate-related environment variables EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET are set, see sample-set-remote-env.sh !!!!\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
|
|
||||||
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.3'
|
|
||||||
compile 'com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.3'
|
|
||||||
testCompile "junit:junit:4.11"
|
testCompile "junit:junit:4.11"
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
||||||
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,15 @@
|
|||||||
<Pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</Pattern>
|
<Pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</Pattern>
|
||||||
</layout>
|
</layout>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<root level="error">
|
<root level="error">
|
||||||
<appender-ref ref="STDOUT" />
|
<appender-ref ref="STDOUT" />
|
||||||
</root>
|
</root>
|
||||||
<logger name="org.springframework" level='debug'>
|
|
||||||
</logger>
|
<logger name="org.springframework" level='info'>
|
||||||
</configuration>
|
</logger>
|
||||||
|
|
||||||
|
<logger name="net.chrisrichardson.eventstore.client" level='info'>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
|
||||||
compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion"
|
compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion"
|
||||||
|
|
||||||
testCompile "junit:junit:4.11"
|
testCompile "junit:junit:4.11"
|
||||||
|
|||||||
@@ -7,11 +7,8 @@ accountscommandside:
|
|||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
environment:
|
environment:
|
||||||
EVENT_STORE_USER_ID:
|
EVENTUATE_API_KEY_ID:
|
||||||
EVENT_STORE_PASSWORD:
|
EVENTUATE_API_KEY_SECRET:
|
||||||
EVENT_STORE_URL:
|
|
||||||
EVENT_STORE_STOMP_SERVER_HOST:
|
|
||||||
EVENT_STORE_STOMP_SERVER_PORT:
|
|
||||||
|
|
||||||
transactionscommandside:
|
transactionscommandside:
|
||||||
image: java:8
|
image: java:8
|
||||||
@@ -22,11 +19,8 @@ transactionscommandside:
|
|||||||
ports:
|
ports:
|
||||||
- "8082:8080"
|
- "8082:8080"
|
||||||
environment:
|
environment:
|
||||||
EVENT_STORE_USER_ID:
|
EVENTUATE_API_KEY_ID:
|
||||||
EVENT_STORE_PASSWORD:
|
EVENTUATE_API_KEY_SECRET:
|
||||||
EVENT_STORE_URL:
|
|
||||||
EVENT_STORE_STOMP_SERVER_HOST:
|
|
||||||
EVENT_STORE_STOMP_SERVER_PORT:
|
|
||||||
|
|
||||||
|
|
||||||
accountsqueryside:
|
accountsqueryside:
|
||||||
@@ -34,17 +28,14 @@ accountsqueryside:
|
|||||||
working_dir: /app
|
working_dir: /app
|
||||||
volumes:
|
volumes:
|
||||||
- ./accounts-query-side-service/build/libs:/app
|
- ./accounts-query-side-service/build/libs:/app
|
||||||
command: java -jar /app/accounts-query-side-service.jar --spring.data.mongodb_uri=mongodb://database/CQRS
|
command: java -jar /app/accounts-query-side-service.jar
|
||||||
ports:
|
ports:
|
||||||
- "8081:8080"
|
- "8081:8080"
|
||||||
links:
|
links:
|
||||||
- mongodb
|
- mongodb
|
||||||
environment:
|
environment:
|
||||||
EVENT_STORE_USER_ID:
|
EVENTUATE_API_KEY_ID:
|
||||||
EVENT_STORE_PASSWORD:
|
EVENTUATE_API_KEY_SECRET:
|
||||||
EVENT_STORE_URL:
|
|
||||||
EVENT_STORE_STOMP_SERVER_HOST:
|
|
||||||
EVENT_STORE_STOMP_SERVER_PORT:
|
|
||||||
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
||||||
|
|
||||||
mongodb:
|
mongodb:
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
|
||||||
org.gradle.jvmargs=-XX:MaxPermSize=512m
|
org.gradle.jvmargs=-XX:MaxPermSize=512m
|
||||||
|
|
||||||
|
eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release
|
||||||
|
|
||||||
scalaTestDependency=org.scalatest:scalatest_2.10:2.0
|
scalaTestDependency=org.scalatest:scalatest_2.10:2.0
|
||||||
|
|
||||||
springBootVersion=1.2.5.RELEASE
|
springBootVersion=1.2.8.RELEASE
|
||||||
|
|
||||||
eventStoreClientVersion=0.7
|
eventStoreClientVersion=0.12
|
||||||
eventStoreCommonVersion=0.7
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ dependencies {
|
|||||||
compile "org.springframework.boot:spring-boot-starter-web"
|
compile "org.springframework.boot:spring-boot-starter-web"
|
||||||
compile "org.springframework.boot:spring-boot-starter-actuator"
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
testCompile project(":testutil")
|
testCompile project(":testutil")
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
|
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
|
||||||
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.3'
|
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.3'
|
||||||
@@ -9,7 +9,7 @@ dependencies {
|
|||||||
compile "junit:junit:4.11"
|
compile "junit:junit:4.11"
|
||||||
|
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
||||||
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,16 +3,12 @@ apply plugin: 'java'
|
|||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
compile project(":common-backend")
|
compile project(":common-backend")
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-java-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
compile 'com.fasterxml.jackson.core:jackson-core:2.4.3'
|
|
||||||
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.3'
|
|
||||||
compile 'com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.3'
|
|
||||||
|
|
||||||
testCompile project(":testutil")
|
testCompile project(":testutil")
|
||||||
testCompile "junit:junit:4.11"
|
testCompile "junit:junit:4.11"
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
|
||||||
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ dependencies {
|
|||||||
compile "org.springframework.boot:spring-boot-starter-web"
|
compile "org.springframework.boot:spring-boot-starter-web"
|
||||||
compile "org.springframework.boot:spring-boot-starter-actuator"
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
# Execute this script in the java-spring or scala-spring directory
|
# Execute this script in the java-spring or scala-spring directory
|
||||||
# Runs all of the services
|
# Runs all of the services
|
||||||
|
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
if [[ -f account-cs.pid ]]; then
|
if [[ -f account-cs.pid ]]; then
|
||||||
echo pid file exists
|
echo pid file exists
|
||||||
exit 1
|
exit 1
|
||||||
@@ -19,13 +21,4 @@ echo $! > transfers-cs.pid
|
|||||||
|
|
||||||
echo -n waiting for services....
|
echo -n waiting for services....
|
||||||
|
|
||||||
while [[ true ]]; do
|
$DIR/wait-for-services.sh localhost
|
||||||
nc -z -w 4 localhost 8080 && nc -z -w 4 localhost 8081 && nc -z -w 4 localhost 8082
|
|
||||||
if [[ "$?" -eq "0" ]]; then
|
|
||||||
echo connected
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
echo -n .
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#! /bin/bash -e
|
#! /bin/bash -e
|
||||||
|
|
||||||
export EVENT_STORE_USER_ID=Aladdin
|
export EVENTUATE_API_KEY_ID=Aladdin
|
||||||
export EVENT_STORE_PASSWORD="open sesame"
|
export EVENTUATE_API_KEY_SECRET="open sesame"
|
||||||
export EVENT_STORE_URL=serverUrl
|
|
||||||
export EVENT_STORE_STOMP_SERVER_HOST=serverhost
|
|
||||||
export EVENT_STORE_STOMP_SERVER_PORT=serverPort
|
|
||||||
|
|
||||||
export SPRING_DATA_MONGODB_URI=mongodb://192.168.59.103/mydb
|
export SPRING_DATA_MONGODB_URI=mongodb://192.168.59.103/mydb
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
dependencies {
|
dependencies {
|
||||||
compile "org.scala-lang:scala-library:2.10.2"
|
compile "org.scala-lang:scala-library:2.10.2"
|
||||||
compile project(":common-backend")
|
compile project(":common-backend")
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling_2.10:$eventStoreClientVersion"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ dependencies {
|
|||||||
compile "org.springframework.boot:spring-boot-starter-web"
|
compile "org.springframework.boot:spring-boot-starter-web"
|
||||||
compile "org.springframework.boot:spring-boot-starter-actuator"
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||||
testCompile scalaTestDependency
|
testCompile scalaTestDependency
|
||||||
|
|||||||
@@ -7,13 +7,10 @@ dependencies {
|
|||||||
compile "org.scala-lang:scala-library:2.10.2"
|
compile "org.scala-lang:scala-library:2.10.2"
|
||||||
compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion"
|
compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion"
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.common:eventstore-common:$eventStoreCommonVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling:$eventStoreClientVersion"
|
|
||||||
|
|
||||||
testCompile scalaTestDependency
|
testCompile scalaTestDependency
|
||||||
|
|
||||||
testCompile "junit:junit:4.11"
|
testCompile "junit:junit:4.11"
|
||||||
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ dependencies {
|
|||||||
compile "org.springframework.boot:spring-boot-starter-web"
|
compile "org.springframework.boot:spring-boot-starter-web"
|
||||||
compile "org.springframework.boot:spring-boot-starter-actuator"
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||||
testCompile scalaTestDependency
|
testCompile scalaTestDependency
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ dependencies {
|
|||||||
testCompile scalaTestDependency
|
testCompile scalaTestDependency
|
||||||
|
|
||||||
testCompile "junit:junit:4.11"
|
testCompile "junit:junit:4.11"
|
||||||
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
3
scala-spring/build-and-test-all.sh
Executable file
3
scala-spring/build-and-test-all.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
../_build-and-test-all.sh $*
|
||||||
@@ -23,13 +23,7 @@ subprojects {
|
|||||||
targetCompatibility = 1.7
|
targetCompatibility = 1.7
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|
||||||
if (project.hasProperty("localMavenRepoUrl")) {
|
|
||||||
project.localMavenRepoUrl.split(',').each { theUrl ->
|
|
||||||
maven { url theUrl }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://06c59145-4e83-4f22-93ef-6a7eee7aebaa.repos.chrisrichardson.net.s3.amazonaws.com" }
|
eventuateMavenRepoUrl.split(',').each { repoUrl -> maven { url repoUrl } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ class VerifyEventStoreEnvironmentPlugin implements Plugin<Project> {
|
|||||||
project.test {
|
project.test {
|
||||||
beforeSuite { x ->
|
beforeSuite { x ->
|
||||||
if (x.parent == null) {
|
if (x.parent == null) {
|
||||||
if (System.getenv("EVENT_STORE_URL") == null)
|
if (System.getenv("EVENTUATE_API_KEY_ID") == null && System.getenv("EVENTUATE_API_KEY_SECRET") == null)
|
||||||
logger.warn("\nPLEASE make sure that Event Store-related environment variables including EVENT_STORE_URL are set, see sample-set-remote-env.sh !!!!\n")
|
logger.warn("\nPLEASE make sure that Eventuate-related environment variables EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET are set, see sample-set-remote-env.sh !!!!\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,9 @@ apply plugin: 'scala'
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.scala-lang:scala-library:2.10.2"
|
compile "org.scala-lang:scala-library:2.10.2"
|
||||||
compile "net.chrisrichardson.eventstore.common:eventstore-common:$eventStoreCommonVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
testCompile scalaTestDependency
|
testCompile scalaTestDependency
|
||||||
|
|
||||||
testCompile "junit:junit:4.11"
|
testCompile "junit:junit:4.11"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
22
scala-spring/common-backend/src/main/resources/logback.xml
Normal file
22
scala-spring/common-backend/src/main/resources/logback.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
|
||||||
|
<!-- [%thread] -->
|
||||||
|
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||||
|
<Pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</Pattern>
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root level="error">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<logger name="org.springframework" level='info'>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="net.chrisrichardson.eventstore.client" level='info'>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
@@ -7,11 +7,8 @@ accountscommandside:
|
|||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
environment:
|
environment:
|
||||||
EVENT_STORE_USER_ID:
|
EVENTUATE_API_KEY_ID:
|
||||||
EVENT_STORE_PASSWORD:
|
EVENTUATE_API_KEY_SECRET:
|
||||||
EVENT_STORE_URL:
|
|
||||||
EVENT_STORE_STOMP_SERVER_HOST:
|
|
||||||
EVENT_STORE_STOMP_SERVER_PORT:
|
|
||||||
|
|
||||||
transactionscommandside:
|
transactionscommandside:
|
||||||
image: java:8
|
image: java:8
|
||||||
@@ -22,11 +19,8 @@ transactionscommandside:
|
|||||||
ports:
|
ports:
|
||||||
- "8082:8080"
|
- "8082:8080"
|
||||||
environment:
|
environment:
|
||||||
EVENT_STORE_USER_ID:
|
EVENTUATE_API_KEY_ID:
|
||||||
EVENT_STORE_PASSWORD:
|
EVENTUATE_API_KEY_SECRET:
|
||||||
EVENT_STORE_URL:
|
|
||||||
EVENT_STORE_STOMP_SERVER_HOST:
|
|
||||||
EVENT_STORE_STOMP_SERVER_PORT:
|
|
||||||
|
|
||||||
|
|
||||||
accountsqueryside:
|
accountsqueryside:
|
||||||
@@ -34,17 +28,14 @@ accountsqueryside:
|
|||||||
working_dir: /app
|
working_dir: /app
|
||||||
volumes:
|
volumes:
|
||||||
- ./accounts-query-side-service/build/libs:/app
|
- ./accounts-query-side-service/build/libs:/app
|
||||||
command: java -jar /app/accounts-query-side-service.jar --spring.data.mongodb_uri=mongodb://database/CQRS
|
command: java -jar /app/accounts-query-side-service.jar
|
||||||
ports:
|
ports:
|
||||||
- "8081:8080"
|
- "8081:8080"
|
||||||
links:
|
links:
|
||||||
- mongodb
|
- mongodb
|
||||||
environment:
|
environment:
|
||||||
EVENT_STORE_USER_ID:
|
EVENTUATE_API_KEY_ID:
|
||||||
EVENT_STORE_PASSWORD:
|
EVENTUATE_API_KEY_SECRET:
|
||||||
EVENT_STORE_URL:
|
|
||||||
EVENT_STORE_STOMP_SERVER_HOST:
|
|
||||||
EVENT_STORE_STOMP_SERVER_PORT:
|
|
||||||
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
||||||
|
|
||||||
mongodb:
|
mongodb:
|
||||||
@@ -18,9 +18,10 @@ import scala.collection.JavaConversions._
|
|||||||
@RunWith(classOf[JUnitRunner])
|
@RunWith(classOf[JUnitRunner])
|
||||||
class EndToEndTest extends FlatSpec {
|
class EndToEndTest extends FlatSpec {
|
||||||
|
|
||||||
val accountsCommandSideBaseUrl = s"http://localhost:8080/"
|
val serviceHost = Option(System.getenv("SERVICE_HOST")) getOrElse "localhost"
|
||||||
val accountsQuerySideBaseUrl = s"http://localhost:8081/"
|
val accountsCommandSideBaseUrl = s"http://$serviceHost:8080/"
|
||||||
val transactionsCommandSideBaseUrl = s"http://localhost:8082/"
|
val accountsQuerySideBaseUrl = s"http://$serviceHost:8081/"
|
||||||
|
val transactionsCommandSideBaseUrl = s"http://$serviceHost:8082/"
|
||||||
|
|
||||||
val restTemplate = new RestTemplate()
|
val restTemplate = new RestTemplate()
|
||||||
restTemplate.getMessageConverters foreach {
|
restTemplate.getMessageConverters foreach {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
|
||||||
org.gradle.jvmargs=-XX:MaxPermSize=512m
|
org.gradle.jvmargs=-XX:MaxPermSize=512m
|
||||||
|
|
||||||
|
eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release
|
||||||
|
|
||||||
scalaTestDependency=org.scalatest:scalatest_2.10:2.0
|
scalaTestDependency=org.scalatest:scalatest_2.10:2.0
|
||||||
|
|
||||||
springBootVersion=1.2.5.RELEASE
|
springBootVersion=1.2.8.RELEASE
|
||||||
|
|
||||||
eventStoreClientVersion=0.7
|
eventStoreClientVersion=0.12
|
||||||
eventStoreCommonVersion=0.7
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ dependencies {
|
|||||||
compile "org.springframework.boot:spring-boot-starter-web"
|
compile "org.springframework.boot:spring-boot-starter-web"
|
||||||
compile "org.springframework.boot:spring-boot-starter-actuator"
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-jdbc:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||||
testCompile scalaTestDependency
|
testCompile scalaTestDependency
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
dependencies {
|
dependencies {
|
||||||
compile "org.scala-lang:scala-library:2.10.2"
|
compile "org.scala-lang:scala-library:2.10.2"
|
||||||
compile project(":common-backend")
|
compile project(":common-backend")
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-client-event-handling_2.10:$eventStoreClientVersion"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ dependencies {
|
|||||||
compile "org.springframework.boot:spring-boot-starter-web"
|
compile "org.springframework.boot:spring-boot-starter-web"
|
||||||
compile "org.springframework.boot:spring-boot-starter-actuator"
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
|
||||||
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client:$eventStoreClientVersion"
|
compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion"
|
||||||
|
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||||
testCompile scalaTestDependency
|
testCompile scalaTestDependency
|
||||||
|
|||||||
11
wait-for-services.sh
Executable file
11
wait-for-services.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
while [[ true ]]; do
|
||||||
|
nc -z -w 4 ${1?} 8080 && nc -z -w 4 ${1?} 8081 && nc -z -w 4 ${1?} 8082
|
||||||
|
if [[ "$?" -eq "0" ]]; then
|
||||||
|
echo connected
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo -n .
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user