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:
Chris Richardson
2015-12-21 15:02:04 -08:00
parent 2135f3f136
commit bbea6d9d2f
41 changed files with 165 additions and 137 deletions

View File

@@ -3,7 +3,7 @@ apply plugin: 'java'
dependencies {
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 'com.fasterxml.jackson.core:jackson-core:2.4.3'
@@ -13,7 +13,7 @@ dependencies {
testCompile project(":testutil")
testCompile "junit:junit:4.11"
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"
}

View File

@@ -12,6 +12,8 @@ import net.chrisrichardson.eventstore.subscriptions.DispatchedEvent;
import net.chrisrichardson.eventstore.subscriptions.EventHandlerMethod;
import net.chrisrichardson.eventstore.subscriptions.EventSubscriber;
import rx.Observable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
@@ -20,6 +22,8 @@ import static net.chrisrichardson.eventstore.javaexamples.banking.backend.querys
@EventSubscriber(id="querySideEventHandlers")
public class AccountQueryWorkflow implements CompoundEventHandler {
private Logger logger = LoggerFactory.getLogger(getClass());
private AccountInfoUpdateService accountInfoUpdateService;
public AccountQueryWorkflow(AccountInfoUpdateService accountInfoUpdateService) {
@@ -31,7 +35,7 @@ public class AccountQueryWorkflow implements CompoundEventHandler {
AccountOpenedEvent event = de.event();
String id = de.getEntityIdentifier().getId();
String eventId = de.eventId().asString();
System.out.println("**************** account version=" + id + ", " + eventId);
logger.info("**************** account version=" + id + ", " + eventId);
BigDecimal initialBalance = event.getInitialBalance();
accountInfoUpdateService.create(id, initialBalance, eventId);
return Observable.just(null);
@@ -43,8 +47,8 @@ public class AccountQueryWorkflow implements CompoundEventHandler {
String moneyTransferId = de.getEntityIdentifier().getId();
String fromAccountId = de.event().getDetails().getFromAccountId().getId();
String toAccountId = de.event().getDetails().getToAccountId().getId();
System.out.println("**************** account version=" + fromAccountId + ", " + de.eventId().asString());
System.out.println("**************** account version=" + toAccountId + ", " + de.eventId().asString());
logger.info("**************** account version=" + fromAccountId + ", " + de.eventId().asString());
logger.info("**************** account version=" + toAccountId + ", " + de.eventId().asString());
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;
AccountChangeInfo ci = new AccountChangeInfo(changeId, transactionId, de.event().getClass().getSimpleName(), amount, balanceDelta);
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);