From ab1ba8b2742d93f28d1cb7c5415e923f7d9f9d96 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Wed, 26 Oct 2016 19:31:30 +0300 Subject: [PATCH 1/4] - fixed logging - updated AuthConfiguration --- .../queryside/accounts/AccountQueryWorkflow.java | 8 ++++---- .../banking/commonauth/AuthConfiguration.java | 15 +++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/java-spring/accounts-query-side-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQueryWorkflow.java b/java-spring/accounts-query-side-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQueryWorkflow.java index 5437c8e..a65f53c 100644 --- a/java-spring/accounts-query-side-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQueryWorkflow.java +++ b/java-spring/accounts-query-side-backend/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/backend/queryside/accounts/AccountQueryWorkflow.java @@ -36,7 +36,7 @@ public void create(DispatchedEvent de) { AccountOpenedEvent event = de.getEvent(); String id = de.getEntityId(); Int128 eventId = de.getEventId(); - logger.info("**************** account version=" + id + ", " + eventId); + logger.info("**************** account version={}, {}", id, eventId); BigDecimal initialBalance = event.getInitialBalance(); String customerId = event.getCustomerId(); @@ -58,8 +58,8 @@ public void recordTransfer(DispatchedEvent de) { String moneyTransferId = de.getEntityId(); String fromAccountId = de.getEvent().getDetails().getFromAccountId(); String toAccountId = de.getEvent().getDetails().getToAccountId(); - logger.info("**************** account version=" + fromAccountId + ", " + eventId); - logger.info("**************** account version=" + toAccountId + ", " + eventId); + logger.info("**************** account version={}, {}", fromAccountId, eventId); + logger.info("**************** account version={}, {}", toAccountId, eventId); AccountTransactionInfo ti = new AccountTransactionInfo(moneyTransferId, fromAccountId, @@ -120,7 +120,7 @@ public void saveChange(DispatchedEvent de, in long balanceDelta = amount * delta; AccountChangeInfo ci = new AccountChangeInfo(changeId, transactionId, de.getEvent().getClass().getSimpleName(), amount, balanceDelta); String accountId = de.getEntityId(); - logger.info("**************** account version=" + accountId + ", " + de.getEventId().asString()); + logger.info("**************** account version={}, {}", accountId, de.getEventId().asString()); accountInfoUpdateService.updateBalance(accountId, changeId, balanceDelta, ci); } diff --git a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java index 70448c2..737bd46 100755 --- a/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java +++ b/java-spring/common-auth/src/main/java/net/chrisrichardson/eventstore/javaexamples/banking/commonauth/AuthConfiguration.java @@ -66,13 +66,16 @@ public AuthenticationManager authenticationManagerBean() throws Exception { @Override protected void configure(HttpSecurity http) throws Exception { - http.csrf().disable() - .httpBasic().and() + http + .csrf() + .disable() + .httpBasic() + .and() .authorizeRequests() - .antMatchers("/index.html", "/", "/**.js", "/**.css").permitAll() - .antMatchers("/swagger-ui.html", "/v2/api-docs").permitAll() - .antMatchers(HttpMethod.POST, "/api/customers", "/api/login").permitAll() - .anyRequest().authenticated().and() + .antMatchers(HttpMethod.POST, "/api/customers", "/api/login").permitAll() + .antMatchers("/api/**").permitAll() + .anyRequest().permitAll() + .and() .addFilterAfter(new StatelessAuthenticationFilter(tokenAuthenticationService), BasicAuthenticationFilter.class); } From 2ca2fb029ee053c5f31015c9518315a30f92bf52 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 19 Jan 2017 02:22:52 +0300 Subject: [PATCH 2/4] - updated eventuate libs version - updated docker-compose script: added a restart config to the app services --- java-spring/docker-compose-common.yml | 6 ++++++ java-spring/gradle.properties | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/java-spring/docker-compose-common.yml b/java-spring/docker-compose-common.yml index 5adaf70..7cd0387 100644 --- a/java-spring/docker-compose-common.yml +++ b/java-spring/docker-compose-common.yml @@ -1,5 +1,6 @@ apigateway: build: ./api-gateway-service/ + restart: unless-stopped ports: - "8080:8080" environment: @@ -13,16 +14,19 @@ apigateway: accountsservice: build: ./accounts-service/ + restart: unless-stopped ports: - "8085:8080" transactionsservice: build: ./transactions-service/ + restart: unless-stopped ports: - "8082:8080" accountsviewservice: build: ./accounts-view-service/ + restart: unless-stopped environment: SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb ports: @@ -30,11 +34,13 @@ accountsviewservice: customersservice: build: ./customers-service/ + restart: unless-stopped ports: - "8083:8080" customersviewservice: build: ./customers-view-service/ + restart: unless-stopped ports: - "8084:8080" environment: diff --git a/java-spring/gradle.properties b/java-spring/gradle.properties index 9aa239b..cfce9bf 100644 --- a/java-spring/gradle.properties +++ b/java-spring/gradle.properties @@ -5,5 +5,5 @@ eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release springBootVersion=1.3.5.RELEASE -eventuateClientVersion=0.12.0.RELEASE -eventuateLocalVersion=0.4.0.RELEASE +eventuateClientVersion=0.14.0.RELEASE +eventuateLocalVersion=0.11.0.RELEASE From e1e37359dd21c6fe5df6e6c5e40e922a801d10ba Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 19 Jan 2017 02:33:16 +0300 Subject: [PATCH 3/4] - fixed repositories --- java-spring/build.gradle | 1 + java-spring/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/java-spring/build.gradle b/java-spring/build.gradle index 8e5161c..611d01c 100644 --- a/java-spring/build.gradle +++ b/java-spring/build.gradle @@ -23,6 +23,7 @@ subprojects { repositories { mavenCentral() + jcenter() eventuateMavenRepoUrl.split(',').each { repoUrl -> maven { url repoUrl } } } } diff --git a/java-spring/gradle.properties b/java-spring/gradle.properties index cfce9bf..1135d71 100644 --- a/java-spring/gradle.properties +++ b/java-spring/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-XX:MaxPermSize=512m -eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release +eventuateMavenRepoUrl= springBootVersion=1.3.5.RELEASE From 1a2378b14f974bf088cde65998a13038a109ba77 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 19 Jan 2017 02:53:37 +0300 Subject: [PATCH 4/4] updated eventuate-local docker images --- java-spring/docker-compose-eventuate-local.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java-spring/docker-compose-eventuate-local.yml b/java-spring/docker-compose-eventuate-local.yml index c08c772..cf549f6 100644 --- a/java-spring/docker-compose-eventuate-local.yml +++ b/java-spring/docker-compose-eventuate-local.yml @@ -1,5 +1,5 @@ zookeeper: - image: eventuateio/eventuateio-local-zookeeper:0.6.0 + image: eventuateio/eventuateio-local-zookeeper:0.9.0 ports: - 2181:2181 - 2888:2888 @@ -7,7 +7,7 @@ zookeeper: kafka: - image: eventuateio/eventuateio-local-kafka:0.6.0 + image: eventuateio/eventuateio-local-kafka:0.9.0 ports: - 9092:9092 links: @@ -18,7 +18,7 @@ kafka: - ZOOKEEPER_SERVERS=zookeeper:2181 mysql: - image: eventuateio/eventuateio-local-mysql:0.6.0 + image: eventuateio/eventuateio-local-mysql:0.9.0 ports: - 3306:3306 environment: @@ -28,7 +28,7 @@ mysql: cdcservice: - image: eventuateio/eventuateio-local-cdc-service:0.6.0 + image: eventuateio/eventuateio-local-cdc-service:0.9.0 ports: - "8099:8080" links: