From e8e741326449d170d21ed6955d72af9cbc33101d Mon Sep 17 00:00:00 2001 From: Main Date: Wed, 13 Jul 2016 21:52:58 +0300 Subject: [PATCH 01/26] - moved to new eventuate-java-client --- java-server/api-gateway-service/build.gradle | 4 +- .../apigateway/ApiGatewayProperties.java | 3 - .../ApiGatewayServiceConfiguration.java | 8 +- .../examples/kanban/apigateway/RestUtil.java | 3 - .../controller/GatewayController.java | 3 - .../main/ApiGatewayServiceMain.java | 3 - .../utils/ContentRequestTransformer.java | 3 - .../utils/HeadersRequestTransformer.java | 3 - .../utils/ProxyRequestTransformer.java | 3 - .../utils/URLRequestTransformer.java | 3 - .../board-command-side-service/build.gradle | 2 +- .../BoardCommandSideServiceConfiguration.java | 7 +- .../main/BoardCommandSideServiceMain.java | 3 - java-server/board-command-side/build.gradle | 2 +- .../commandside/board/BoardAggregate.java | 9 +- .../commandside/board/BoardCommand.java | 6 +- .../board/BoardCommandController.java | 24 ++-- .../board/BoardCommandSideConfiguration.java | 13 +- .../commandside/board/BoardService.java | 12 +- .../commandside/board/CreateBoardCommand.java | 3 - .../board-query-side-service/build.gradle | 4 +- .../BoardQuerySideServiceConfiguration.java | 7 +- .../main/BoardQuerySideServiceMain.java | 3 - .../queryside/board/BoardQueryController.java | 3 - .../board/BoardQuerySideConfiguration.java | 15 +-- .../queryside/board/BoardQueryWorkflow.java | 23 ++-- .../queryside/board/BoardRepository.java | 3 - .../queryside/board/BoardUpdateService.java | 3 - .../commonauth/controller/AuthController.java | 3 - .../kanban/commonauth/model/AuthRequest.java | 3 - .../kanban/commonauth/model/AuthResponse.java | 3 - .../kanban/commonauth/AuthConfiguration.java | 3 - .../kanban/commonauth/AuthProperties.java | 3 - .../TokenAuthenticationService.java | 3 - .../filter/StatelessAuthenticationFilter.java | 3 - .../kanban/commonauth/model/User.java | 3 - .../commonauth/model/UserAuthentication.java | 3 - java-server/common-board/build.gradle | 4 +- .../kanban/common/board/BoardInfo.java | 3 - .../common/board/event/BoardCreatedEvent.java | 3 - .../kanban/common/board/event/BoardEvent.java | 8 +- .../kanban/common/board/model/Board.java | 3 - .../board/model/BoardQueryResponse.java | 3 - .../common/board/model/BoardResponse.java | 3 - .../board/model/BoardsQueryResponse.java | 3 - java-server/common-swagger/build.gradle | 2 +- .../CommonSwaggerConfiguration.java | 9 +- java-server/common-task/build.gradle | 4 +- .../kanban/common/task/TaskDescription.java | 3 - .../kanban/common/task/TaskDetails.java | 3 - .../examples/kanban/common/task/TaskInfo.java | 4 - .../kanban/common/task/TaskStatus.java | 3 - .../common/task/event/DetailedTaskEvent.java | 3 - .../common/task/event/TaskBacklogEvent.java | 4 - .../common/task/event/TaskCompletedEvent.java | 4 - .../common/task/event/TaskCreatedEvent.java | 3 - .../common/task/event/TaskDeletedEvent.java | 3 - .../kanban/common/task/event/TaskEvent.java | 8 +- .../common/task/event/TaskScheduledEvent.java | 3 - .../common/task/event/TaskStartedEvent.java | 3 - .../common/task/event/TaskUpdatedEvent.java | 3 - .../common/task/model/BacklogResponse.java | 3 - .../task/model/ChangeTaskStatusRequest.java | 3 - .../common/task/model/HistoryEvent.java | 5 +- .../common/task/model/HistoryResponse.java | 3 - .../kanban/common/task/model/Task.java | 3 - .../common/task/model/TaskResponse.java | 3 - java-server/common-web/build.gradle | 2 +- .../kanban/commonweb/WebConfiguration.java | 18 --- .../kanban/commonweb/filter/CORSFilter.java | 3 - .../kanban/commonweb/util/DeferredUtils.java | 37 ------ .../commonweb/util/HttpExceptionHandler.java | 3 - .../util/ObservableReturnValueHandler.java | 30 ----- java-server/common-websocket/build.gradle | 2 +- .../commonwebsocket/WebSocketConfig.java | 10 +- .../WebSocketSecurityConfig.java | 3 - .../WebsocketEventsTranslator.java | 125 +++++++++--------- .../model/KanbanWebSocketEvent.java | 3 - java-server/common/build.gradle | 2 +- .../kanban/common/model/AuditEntry.java | 3 - java-server/e2e-test/build.gradle | 2 +- .../kanban/e2etest/AuthControllerTest.java | 3 - .../kanban/e2etest/E2ETestConfiguration.java | 7 +- .../examples/kanban/e2etest/RestApiTest.java | 3 - .../examples/kanban/e2etest/StompApiTest.java | 7 - java-server/gradle.properties | 7 +- .../rest-api-integration-tests/build.gradle | 2 +- .../integrationtests/AuthControllerTest.java | 3 - .../RestAPITestConfiguration.java | 8 +- .../kanban/integrationtests/RestApiTest.java | 3 - .../kanban/integrationtests/StompApiTest.java | 5 - java-server/standalone-service/build.gradle | 8 +- .../StandaloneServiceConfiguration.java | 7 +- .../main/StandaloneServiceMain.java | 4 - .../task-command-side-service/build.gradle | 2 +- .../TaskCommandSideServiceConfiguration.java | 8 +- .../main/TaskCommandSideServiceMain.java | 3 - java-server/task-command-side/build.gradle | 2 +- .../commandside/task/CompleteTaskCommand.java | 3 - .../commandside/task/CreateTaskCommand.java | 3 - .../commandside/task/DeleteTaskCommand.java | 3 - .../task/MoveToBacklogTaskCommand.java | 3 - .../commandside/task/ScheduleTaskCommand.java | 3 - .../commandside/task/StartTaskCommand.java | 3 - .../commandside/task/TaskAggregate.java | 9 +- .../kanban/commandside/task/TaskCommand.java | 6 +- .../task/TaskCommandController.java | 65 +++++---- .../task/TaskCommandSideConfiguration.java | 13 +- .../commandside/task/TaskHistoryService.java | 18 +-- .../kanban/commandside/task/TaskService.java | 36 +++-- .../commandside/task/UpdateTaskCommand.java | 3 - .../task-query-side-service/build.gradle | 4 +- .../TaskQuerySideServiceConfiguration.java | 4 +- .../queryside/task/TaskQueryController.java | 3 - .../task/TaskQuerySideConfiguration.java | 11 +- .../queryside/task/TaskQueryWorkflow.java | 77 +++++------ java-server/test-utils/build.gradle | 3 +- .../kanban/testutil/AbstractAuthTest.java | 3 - .../kanban/testutil/AbstractRestApiTest.java | 3 - .../kanban/testutil/AbstractStompApiTest.java | 5 - .../examples/kanban/testutil/BaseTest.java | 3 - .../testutil/BasicWebTestConfiguration.java | 3 - .../client/ConsumerStompMessageHandler.java | 3 - .../testutil/model/TestHistoryEvent.java | 7 +- .../testutil/model/TestHistoryResponse.java | 3 - .../kanban/testutil/util/StompListener.java | 3 - .../kanban/testutil/util/TestUtil.java | 3 - .../kanban/testutil/util/ValidationUtils.java | 3 - 128 files changed, 256 insertions(+), 695 deletions(-) delete mode 100755 java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/DeferredUtils.java delete mode 100755 java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/ObservableReturnValueHandler.java diff --git a/java-server/api-gateway-service/build.gradle b/java-server/api-gateway-service/build.gradle index 7b431253..039d9672 100755 --- a/java-server/api-gateway-service/build.gradle +++ b/java-server/api-gateway-service/build.gradle @@ -11,8 +11,8 @@ dependencies { compile "org.apache.httpcomponents:httpclient:4.5" compile "org.apache.httpcomponents:fluent-hc:4.5.1" - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" - compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayProperties.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayProperties.java index 1fede8ad..755ee950 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayProperties.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayProperties.java @@ -5,9 +5,6 @@ import java.util.List; -/** - * Created by popikyardo on 15.01.16. - */ @ConfigurationProperties(prefix = "api.gateway") public class ApiGatewayProperties { diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java index 6efded25..a7ca9056 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java @@ -1,7 +1,7 @@ package net.chrisrichardson.eventstore.examples.kanban.apigateway; import com.fasterxml.jackson.databind.ObjectMapper; -import net.chrisrichardson.eventstore.client.config.EventStoreHttpClientConfiguration; +import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebSocketConfig; @@ -9,7 +9,6 @@ import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebsocketEventsTranslator; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.web.HttpMessageConverters; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -25,12 +24,9 @@ import java.util.Collections; -/** - * Created by popikyardo on 15.01.16. - */ @Configuration @ComponentScan -@Import({EventStoreHttpClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class}) +@Import({EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class}) @EnableConfigurationProperties({ApiGatewayProperties.class}) public class ApiGatewayServiceConfiguration { diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/RestUtil.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/RestUtil.java index 266e3a4c..70f8fb6a 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/RestUtil.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/RestUtil.java @@ -2,9 +2,6 @@ import org.springframework.http.HttpStatus; -/** - * Created by popikyardo on 07.12.15. - */ public class RestUtil { public static boolean isError(HttpStatus status) { diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/controller/GatewayController.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/controller/GatewayController.java index 8ab8426e..18b45313 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/controller/GatewayController.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/controller/GatewayController.java @@ -27,9 +27,6 @@ import static org.springframework.web.bind.annotation.RequestMethod.*; -/** - * Created by popikyardo on 15.01.16. - */ @RestController @RequestMapping("/api") public class GatewayController { diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/main/ApiGatewayServiceMain.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/main/ApiGatewayServiceMain.java index bb0af02e..6fcf93cc 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/main/ApiGatewayServiceMain.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/main/ApiGatewayServiceMain.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.apigateway.ApiGatewayServiceConfiguration; import org.springframework.boot.SpringApplication; -/** - * Created by Main on 19.01.2016. - */ public class ApiGatewayServiceMain { public static void main(String[] args) { SpringApplication.run(ApiGatewayServiceConfiguration.class, args); diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/ContentRequestTransformer.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/ContentRequestTransformer.java index 18207dba..69cb1e15 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/ContentRequestTransformer.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/ContentRequestTransformer.java @@ -10,9 +10,6 @@ import java.net.URISyntaxException; import java.util.stream.Collectors; -/** - * Created by popikyardo on 21.01.16. - */ public class ContentRequestTransformer extends ProxyRequestTransformer { @Override diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/HeadersRequestTransformer.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/HeadersRequestTransformer.java index 9b04bc1f..65e348c2 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/HeadersRequestTransformer.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/HeadersRequestTransformer.java @@ -8,9 +8,6 @@ import java.net.URISyntaxException; import java.util.Enumeration; -/** - * Created by popikyardo on 21.01.16. - */ public class HeadersRequestTransformer extends ProxyRequestTransformer { diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/ProxyRequestTransformer.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/ProxyRequestTransformer.java index 3b88182d..a11d98b5 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/ProxyRequestTransformer.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/ProxyRequestTransformer.java @@ -7,9 +7,6 @@ import java.io.IOException; import java.net.URISyntaxException; -/** - * Created by popikyardo on 21.01.16. - */ public abstract class ProxyRequestTransformer { protected ProxyRequestTransformer predecessor; diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/URLRequestTransformer.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/URLRequestTransformer.java index d91420ad..a86c5b2c 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/URLRequestTransformer.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/utils/URLRequestTransformer.java @@ -9,9 +9,6 @@ import java.net.URI; import java.net.URISyntaxException; -/** - * Created by popikyardo on 21.01.16. - */ public class URLRequestTransformer extends ProxyRequestTransformer { private ApiGatewayProperties apiGatewayProperties; diff --git a/java-server/board-command-side-service/build.gradle b/java-server/board-command-side-service/build.gradle index 97f5cfb8..075be121 100755 --- a/java-server/board-command-side-service/build.gradle +++ b/java-server/board-command-side-service/build.gradle @@ -9,6 +9,6 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" testCompile "junit:junit:4.11" } \ No newline at end of file diff --git a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java b/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java index 2fda0df4..0d48d3f1 100755 --- a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java +++ b/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java @@ -1,6 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.boardcommandsideservice; -import net.chrisrichardson.eventstore.client.config.EventStoreHttpClientConfiguration; +import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; @@ -10,11 +10,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -/** - * Created by Main on 19.01.2016. - */ @Configuration -@Import({BoardCommandSideConfiguration.class, EventStoreHttpClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({BoardCommandSideConfiguration.class, EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class BoardCommandSideServiceConfiguration { diff --git a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/main/BoardCommandSideServiceMain.java b/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/main/BoardCommandSideServiceMain.java index dfc9c179..20c3fedb 100755 --- a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/main/BoardCommandSideServiceMain.java +++ b/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/main/BoardCommandSideServiceMain.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.boardcommandsideservice.BoardCommandSideServiceConfiguration; import org.springframework.boot.SpringApplication; -/** - * Created by Main on 19.01.2016. - */ public class BoardCommandSideServiceMain { public static void main(String[] args) { SpringApplication.run(BoardCommandSideServiceConfiguration.class, args); diff --git a/java-server/board-command-side/build.gradle b/java-server/board-command-side/build.gradle index d01fb29d..df224f43 100755 --- a/java-server/board-command-side/build.gradle +++ b/java-server/board-command-side/build.gradle @@ -4,7 +4,7 @@ dependencies { compile project(":common-board") compile project(":common-web") - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardAggregate.java b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardAggregate.java index 43329b72..e2906df2 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardAggregate.java +++ b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardAggregate.java @@ -1,8 +1,8 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.board; -import net.chrisrichardson.eventstore.Event; -import net.chrisrichardson.eventstore.EventUtil; -import net.chrisrichardson.eventstore.ReflectiveMutableCommandProcessingAggregate; +import io.eventuate.Event; +import io.eventuate.EventUtil; +import io.eventuate.ReflectiveMutableCommandProcessingAggregate; import net.chrisrichardson.eventstore.examples.kanban.common.board.event.BoardCreatedEvent; import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; import org.slf4j.Logger; @@ -10,9 +10,6 @@ import java.util.List; -/** - * Created by popikyardo on 21.09.15. - */ public class BoardAggregate extends ReflectiveMutableCommandProcessingAggregate { private BoardInfo board; diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommand.java b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommand.java index 1160299e..349b4082 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommand.java +++ b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommand.java @@ -1,9 +1,7 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.board; -import net.chrisrichardson.eventstore.Command; -/** - * Created by popikyardo on 21.09.15. - */ +import io.eventuate.Command; + public interface BoardCommand extends Command { } diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandController.java b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandController.java index cc16549b..14d2b1ca 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandController.java +++ b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandController.java @@ -1,6 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.board; -import net.chrisrichardson.eventstore.EntityWithIdAndVersion; +import io.eventuate.EntityWithIdAndVersion; import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; import net.chrisrichardson.eventstore.examples.kanban.common.board.model.BoardResponse; import org.slf4j.Logger; @@ -9,13 +9,11 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import rx.Observable; + +import java.util.concurrent.CompletableFuture; import static org.springframework.web.bind.annotation.RequestMethod.POST; -/** - * Created by Main on 02.10.2015. - */ @RestController @RequestMapping(value = "/api") public class BoardCommandController { @@ -26,16 +24,16 @@ public class BoardCommandController { private static Logger log = LoggerFactory.getLogger(BoardCommandController.class); @RequestMapping(value = "/boards", method = POST) - public Observable saveBoard(@RequestBody BoardInfo board) { - return boardService.save(board).map(this::makeBoardResponse); + public CompletableFuture saveBoard(@RequestBody BoardInfo board) { + return boardService.save(board).thenApply(this::makeBoardResponse); } private BoardResponse makeBoardResponse(EntityWithIdAndVersion e) { - return new BoardResponse(e.getEntityIdentifier().getId(), - e.entity().getBoard().getTitle(), - e.entity().getBoard().getCreation().getWho(), - e.entity().getBoard().getCreation().getWhen(), - e.entity().getBoard().getUpdate().getWho(), - e.entity().getBoard().getUpdate().getWhen()); + return new BoardResponse(e.getEntityId(), + e.getAggregate().getBoard().getTitle(), + e.getAggregate().getBoard().getCreation().getWho(), + e.getAggregate().getBoard().getCreation().getWhen(), + e.getAggregate().getBoard().getUpdate().getWho(), + e.getAggregate().getBoard().getUpdate().getWhen()); } } diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandSideConfiguration.java b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandSideConfiguration.java index a4e3c7da..62673169 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandSideConfiguration.java +++ b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandSideConfiguration.java @@ -1,26 +1,25 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.board; -import net.chrisrichardson.eventstore.EventStore; -import net.chrisrichardson.eventstore.repository.AggregateRepository; -import net.chrisrichardson.eventstore.subscriptions.config.EventStoreSubscriptionsConfiguration; +import io.eventuate.AggregateRepository; +import io.eventuate.EventuateAggregateStore; +import io.eventuate.javaclient.spring.EnableEventHandlers; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration; import org.springframework.boot.autoconfigure.web.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; @Configuration -@Import({EventStoreSubscriptionsConfiguration.class}) +@EnableEventHandlers @EnableAutoConfiguration(exclude = {MongoRepositoriesAutoConfiguration.class}) @ComponentScan public class BoardCommandSideConfiguration { @Bean - public AggregateRepository boardAggregateRepository(EventStore eventStore) { + public AggregateRepository boardAggregateRepository(EventuateAggregateStore eventStore) { return new AggregateRepository<>(BoardAggregate.class, eventStore); } @@ -36,5 +35,3 @@ public HttpMessageConverters customConverters() { } } - - diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardService.java b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardService.java index 83450c95..cfe6cbc5 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardService.java +++ b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardService.java @@ -1,15 +1,13 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.board; -import net.chrisrichardson.eventstore.EntityWithIdAndVersion; +import io.eventuate.AggregateRepository; +import io.eventuate.EntityWithIdAndVersion; import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; -import net.chrisrichardson.eventstore.repository.AggregateRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import rx.Observable; -/** - * Created by popikyardo on 21.09.15. - */ +import java.util.concurrent.CompletableFuture; + public class BoardService { private final AggregateRepository aggregateRepository; @@ -20,7 +18,7 @@ public BoardService(AggregateRepository aggregateR this.aggregateRepository = aggregateRepository; } - public Observable> save(BoardInfo board) { + public CompletableFuture> save(BoardInfo board) { log.info("BoardService saving : {}", board); return aggregateRepository.save(new CreateBoardCommand(board)); diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/CreateBoardCommand.java b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/CreateBoardCommand.java index 2b8fac1a..173ba87d 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/CreateBoardCommand.java +++ b/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/CreateBoardCommand.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by popikyardo on 21.09.15. - */ public class CreateBoardCommand implements BoardCommand { private BoardInfo boardInfo; diff --git a/java-server/board-query-side-service/build.gradle b/java-server/board-query-side-service/build.gradle index f25f5254..b32d7aeb 100755 --- a/java-server/board-query-side-service/build.gradle +++ b/java-server/board-query-side-service/build.gradle @@ -9,7 +9,7 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" - compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" testCompile "junit:junit:4.11" } diff --git a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java b/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java index 442c81d4..4186cf10 100755 --- a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java +++ b/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java @@ -1,6 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.boardquerysideservice; -import net.chrisrichardson.eventstore.client.config.EventStoreHttpClientConfiguration; +import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; @@ -10,11 +10,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -/** - * Created by Main on 19.01.2016. - */ @Configuration -@Import({BoardQuerySideConfiguration.class, EventStoreHttpClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({BoardQuerySideConfiguration.class, EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class BoardQuerySideServiceConfiguration { diff --git a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/main/BoardQuerySideServiceMain.java b/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/main/BoardQuerySideServiceMain.java index df4759c3..854adb48 100755 --- a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/main/BoardQuerySideServiceMain.java +++ b/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/main/BoardQuerySideServiceMain.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.boardquerysideservice.BoardQuerySideServiceConfiguration; import org.springframework.boot.SpringApplication; -/** - * Created by Main on 19.01.2016. - */ public class BoardQuerySideServiceMain { public static void main(String[] args) { SpringApplication.run(BoardQuerySideServiceConfiguration.class, args); diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryController.java b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryController.java index 65e73be4..89f47abe 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryController.java +++ b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryController.java @@ -14,9 +14,6 @@ import static org.springframework.http.HttpStatus.OK; import static org.springframework.web.bind.annotation.RequestMethod.GET; -/** - * Created by popikyardo on 19/09/2015. - */ @RestController public class BoardQueryController { diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQuerySideConfiguration.java b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQuerySideConfiguration.java index 31216367..ebe096ec 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQuerySideConfiguration.java +++ b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQuerySideConfiguration.java @@ -1,32 +1,21 @@ package net.chrisrichardson.eventstore.examples.kanban.queryside.board; -import net.chrisrichardson.eventstore.javaapi.consumer.EnableJavaEventHandlers; -import net.chrisrichardson.eventstore.subscriptions.config.EventStoreSubscriptionsConfiguration; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import io.eventuate.javaclient.spring.EnableEventHandlers; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.web.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.data.mongodb.MongoDbFactory; -import org.springframework.data.mongodb.core.convert.*; -import org.springframework.data.mongodb.core.mapping.MongoMappingContext; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -/** - * Created by popikyardo on 21.09.15. - */ @Configuration -@Import({EventStoreSubscriptionsConfiguration.class}) +@EnableEventHandlers @EnableAutoConfiguration @ComponentScan @EnableMongoRepositories -@EnableJavaEventHandlers public class BoardQuerySideConfiguration { @Bean diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryWorkflow.java b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryWorkflow.java index ad0e01fe..f0886427 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryWorkflow.java +++ b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryWorkflow.java @@ -1,19 +1,14 @@ package net.chrisrichardson.eventstore.examples.kanban.queryside.board; +import io.eventuate.DispatchedEvent; +import io.eventuate.EventHandlerMethod; +import io.eventuate.EventSubscriber; import net.chrisrichardson.eventstore.examples.kanban.common.board.event.BoardCreatedEvent; -import net.chrisrichardson.eventstore.subscriptions.CompoundEventHandler; -import net.chrisrichardson.eventstore.subscriptions.DispatchedEvent; -import net.chrisrichardson.eventstore.subscriptions.EventHandlerMethod; -import net.chrisrichardson.eventstore.subscriptions.EventSubscriber; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import rx.Observable; -/** - * Created by popikyardo on 21.09.15. - */ @EventSubscriber(id = "boardEventHandlers") -public class BoardQueryWorkflow implements CompoundEventHandler { +public class BoardQueryWorkflow{ private BoardUpdateService boardUpdateService; private static Logger log = LoggerFactory.getLogger(BoardQueryWorkflow.class); @@ -23,13 +18,11 @@ public BoardQueryWorkflow(BoardUpdateService boardInfoUpdateService) { } @EventHandlerMethod - public Observable create(DispatchedEvent de) { - BoardCreatedEvent event = de.event(); - String id = de.getEntityIdentifier().getId(); + public void create(DispatchedEvent de) { + BoardCreatedEvent event = de.getEvent(); + String id = de.getEntityId(); - log.info("BoardQueryWorkflow got event : {}", de.event()); + log.info("BoardQueryWorkflow got event : {}", de.getEvent()); boardUpdateService.create(id, event.getBoardInfo()); - - return Observable.just(null); } } \ No newline at end of file diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardRepository.java b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardRepository.java index 711aca7a..46f28318 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardRepository.java +++ b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardRepository.java @@ -3,8 +3,5 @@ import net.chrisrichardson.eventstore.examples.kanban.common.board.model.Board; import org.springframework.data.mongodb.repository.MongoRepository; -/** - * Created by popikyardo on 21.09.15. - */ public interface BoardRepository extends MongoRepository { } diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardUpdateService.java b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardUpdateService.java index 3b640b26..b266fa60 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardUpdateService.java +++ b/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardUpdateService.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; import net.chrisrichardson.eventstore.examples.kanban.common.board.model.Board; -/** - * Created by popikyardo on 21.09.15. - */ public class BoardUpdateService { private BoardRepository boardRepository; diff --git a/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/controller/AuthController.java b/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/controller/AuthController.java index 4f3cbec2..cca2a7b1 100755 --- a/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/controller/AuthController.java +++ b/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/controller/AuthController.java @@ -19,9 +19,6 @@ import static org.springframework.web.bind.annotation.RequestMethod.POST; -/** - * Created by popikyardo on 21.09.15. - */ @RestController @Validated public class AuthController { diff --git a/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/AuthRequest.java b/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/AuthRequest.java index cabae774..8c0da8ee 100755 --- a/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/AuthRequest.java +++ b/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/AuthRequest.java @@ -3,9 +3,6 @@ import org.hibernate.validator.constraints.Email; import org.hibernate.validator.constraints.NotBlank; -/** - * Created by popikyardo on 19.10.15. - */ public class AuthRequest { @NotBlank diff --git a/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/AuthResponse.java b/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/AuthResponse.java index fe43efd6..5c4237ce 100755 --- a/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/AuthResponse.java +++ b/java-server/common-auth-controller/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/AuthResponse.java @@ -1,8 +1,5 @@ package net.chrisrichardson.eventstore.examples.kanban.commonauth.model; -/** - * Created by popikyardo on 21.09.15. - */ public class AuthResponse { private String token; diff --git a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/AuthConfiguration.java b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/AuthConfiguration.java index c3b8c1e0..33074ab7 100755 --- a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/AuthConfiguration.java +++ b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/AuthConfiguration.java @@ -18,9 +18,6 @@ import java.security.SecureRandom; -/** - * Created by popikyardo on 21.09.15. - */ @Configuration @ComponentScan("net.chrisrichardson.eventstore.examples.kanban.commonauth") @EnableWebSecurity diff --git a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/AuthProperties.java b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/AuthProperties.java index 3803f29c..3eecd66f 100755 --- a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/AuthProperties.java +++ b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/AuthProperties.java @@ -2,9 +2,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties; -/** - * Created by popikyardo on 21.09.15. - */ @ConfigurationProperties(locations = "classpath:auth.properties", ignoreUnknownFields = false, prefix = "auth") public class AuthProperties { private String serverSecret; diff --git a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/TokenAuthenticationService.java b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/TokenAuthenticationService.java index 4993e92a..b8df4f18 100755 --- a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/TokenAuthenticationService.java +++ b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/TokenAuthenticationService.java @@ -12,9 +12,6 @@ import javax.servlet.http.HttpServletRequest; import java.io.IOException; -/** - * Created by popikyardo on 23.09.15. - */ @Service public class TokenAuthenticationService { diff --git a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/filter/StatelessAuthenticationFilter.java b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/filter/StatelessAuthenticationFilter.java index 6302faaa..682d8f7d 100755 --- a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/filter/StatelessAuthenticationFilter.java +++ b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/filter/StatelessAuthenticationFilter.java @@ -11,9 +11,6 @@ import javax.servlet.http.HttpServletRequest; import java.io.IOException; -/** - * Created by popikyardo on 23.09.15. - */ public class StatelessAuthenticationFilter extends GenericFilterBean { private final TokenAuthenticationService tokenAuthenticationService; diff --git a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/User.java b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/User.java index b6e94b7b..634df67d 100755 --- a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/User.java +++ b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/User.java @@ -10,9 +10,6 @@ import java.util.HashSet; import java.util.Set; -/** - * Created by popikyardo on 23.09.15. - */ @JsonIgnoreProperties(ignoreUnknown = true) public class User implements UserDetails { diff --git a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/UserAuthentication.java b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/UserAuthentication.java index 434bea14..fa2df8b0 100755 --- a/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/UserAuthentication.java +++ b/java-server/common-auth/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonauth/model/UserAuthentication.java @@ -5,9 +5,6 @@ import java.util.Collection; -/** - * Created by popikyardo on 23.09.15. - */ public class UserAuthentication implements Authentication { private final User user; diff --git a/java-server/common-board/build.gradle b/java-server/common-board/build.gradle index 04b41163..a3ff59b1 100755 --- a/java-server/common-board/build.gradle +++ b/java-server/common-board/build.gradle @@ -3,7 +3,9 @@ apply plugin: 'java' dependencies { compile project(":common") - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" + compile "com.fasterxml.jackson.core:jackson-annotations:2.6.0" + + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" testCompile "junit:junit:4.11" diff --git a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/BoardInfo.java b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/BoardInfo.java index 76d49d05..80eeabac 100755 --- a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/BoardInfo.java +++ b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/BoardInfo.java @@ -3,9 +3,6 @@ import org.apache.commons.lang.builder.ToStringBuilder; import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; -/** - * Created by popikyardo on 21.09.15. - */ public class BoardInfo { private String title; private AuditEntry creation; diff --git a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardCreatedEvent.java b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardCreatedEvent.java index eae1d855..559ccf96 100755 --- a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardCreatedEvent.java +++ b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardCreatedEvent.java @@ -4,9 +4,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by popikyardo on 21.09.15. - */ public class BoardCreatedEvent extends BoardEvent { @JsonUnwrapped private BoardInfo boardInfo; diff --git a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardEvent.java b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardEvent.java index 68402d7f..3a18fa3b 100755 --- a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardEvent.java +++ b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardEvent.java @@ -1,11 +1,9 @@ package net.chrisrichardson.eventstore.examples.kanban.common.board.event; -import net.chrisrichardson.eventstore.Event; -import net.chrisrichardson.eventstore.EventEntity; -/** - * Created by popikyardo on 20.10.15. - */ +import io.eventuate.Event; +import io.eventuate.EventEntity; + @EventEntity(entity = "net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardAggregate") public class BoardEvent implements Event { } diff --git a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/Board.java b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/Board.java index 652a9e26..c557ceb8 100755 --- a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/Board.java +++ b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/Board.java @@ -7,9 +7,6 @@ import java.util.Date; -/** - * Created by popikyardo on 07.10.15. - */ @JsonIgnoreProperties(ignoreUnknown = true) public class Board { @Id diff --git a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardQueryResponse.java b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardQueryResponse.java index 853ecc51..ebf4b95d 100755 --- a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardQueryResponse.java +++ b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardQueryResponse.java @@ -1,8 +1,5 @@ package net.chrisrichardson.eventstore.examples.kanban.common.board.model; -/** - * Created by popikyardo on 23.10.15. - */ public class BoardQueryResponse { private Board data; diff --git a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardResponse.java b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardResponse.java index ada00d9e..ba3a4e85 100755 --- a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardResponse.java +++ b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardResponse.java @@ -2,9 +2,6 @@ import java.util.Date; -/** - * Created by popikyardo on 14.10.15. - */ public class BoardResponse { private String id; private String title; diff --git a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardsQueryResponse.java b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardsQueryResponse.java index ed1570b8..32a99ae5 100755 --- a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardsQueryResponse.java +++ b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardsQueryResponse.java @@ -2,9 +2,6 @@ import java.util.List; -/** - * Created by popikyardo on 23.10.15. - */ public class BoardsQueryResponse { private List boards; diff --git a/java-server/common-swagger/build.gradle b/java-server/common-swagger/build.gradle index 4909a39a..13c65ebb 100755 --- a/java-server/common-swagger/build.gradle +++ b/java-server/common-swagger/build.gradle @@ -1,5 +1,5 @@ dependencies { - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" compile "io.springfox:springfox-swagger2:2.3.0" compile "io.springfox:springfox-swagger-ui:2.3.0" diff --git a/java-server/common-swagger/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonswagger/CommonSwaggerConfiguration.java b/java-server/common-swagger/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonswagger/CommonSwaggerConfiguration.java index ae5b4620..33258d9e 100755 --- a/java-server/common-swagger/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonswagger/CommonSwaggerConfiguration.java +++ b/java-server/common-swagger/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonswagger/CommonSwaggerConfiguration.java @@ -1,22 +1,19 @@ package net.chrisrichardson.eventstore.examples.kanban.commonswagger; -/** - * Created by popikyardo on 06.01.16. - */ - import com.fasterxml.classmate.TypeResolver; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.ResponseEntity; import org.springframework.web.context.request.async.DeferredResult; -import rx.Observable; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.schema.WildcardType; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; +import java.util.concurrent.CompletableFuture; + import static springfox.documentation.schema.AlternateTypeRules.newRule; @Configuration @@ -30,7 +27,7 @@ public Docket api() { .apis(RequestHandlerSelectors.basePackage("net.chrisrichardson.eventstore.examples.kanban")) .build() .pathMapping("/") - .genericModelSubstitutes(ResponseEntity.class, Observable.class) + .genericModelSubstitutes(ResponseEntity.class, CompletableFuture.class) .alternateTypeRules( newRule(typeResolver.resolve(DeferredResult.class, typeResolver.resolve(ResponseEntity.class, WildcardType.class)), diff --git a/java-server/common-task/build.gradle b/java-server/common-task/build.gradle index 04b41163..a3ff59b1 100755 --- a/java-server/common-task/build.gradle +++ b/java-server/common-task/build.gradle @@ -3,7 +3,9 @@ apply plugin: 'java' dependencies { compile project(":common") - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" + compile "com.fasterxml.jackson.core:jackson-annotations:2.6.0" + + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" testCompile "junit:junit:4.11" diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskDescription.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskDescription.java index 779065a8..9bf65ed8 100644 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskDescription.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskDescription.java @@ -3,9 +3,6 @@ import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; -/** - * Created by popikyardo on 26.10.15. - */ public class TaskDescription { private String description; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskDetails.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskDetails.java index 1c33d8e8..0a76343c 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskDetails.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskDetails.java @@ -4,9 +4,6 @@ import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by popikyardo on 08.01.16. - */ public class TaskDetails { private String title; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskInfo.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskInfo.java index 451a1c98..27fc3293 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskInfo.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskInfo.java @@ -3,10 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; - -/** - * Created by popikyardo on 21.09.15. - */ public class TaskInfo { private String boardId; private TaskDetails taskDetails; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskStatus.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskStatus.java index c0b99104..663908d9 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskStatus.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/TaskStatus.java @@ -1,8 +1,5 @@ package net.chrisrichardson.eventstore.examples.kanban.common.task; -/** - * Created by popikyardo on 28.10.15. - */ public enum TaskStatus { backlog, scheduled, started, completed } diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/DetailedTaskEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/DetailedTaskEvent.java index 9f7003fe..a4ca3ed7 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/DetailedTaskEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/DetailedTaskEvent.java @@ -2,9 +2,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; -/** - * Created by popikyardo on 18.12.15. - */ public interface DetailedTaskEvent { String getBoardId(); diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskBacklogEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskBacklogEvent.java index c17b0d25..eadc5c72 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskBacklogEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskBacklogEvent.java @@ -3,10 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by Main on 17.10.2015. - */ - public class TaskBacklogEvent extends TaskEvent { private AuditEntry update; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskCompletedEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskCompletedEvent.java index 7f165140..6c1885ac 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskCompletedEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskCompletedEvent.java @@ -3,10 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by Main on 17.10.2015. - */ - public class TaskCompletedEvent extends TaskEvent implements DetailedTaskEvent { private String boardId; private AuditEntry update; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskCreatedEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskCreatedEvent.java index e49426eb..26a7930d 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskCreatedEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskCreatedEvent.java @@ -4,9 +4,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskInfo; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by popikyardo on 21.09.15. - */ public class TaskCreatedEvent extends TaskEvent { @JsonUnwrapped private TaskInfo taskInfo; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskDeletedEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskDeletedEvent.java index 1fe15906..4c9cd7ae 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskDeletedEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskDeletedEvent.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by Main on 17.10.2015. - */ public class TaskDeletedEvent extends TaskEvent implements DetailedTaskEvent { private AuditEntry update; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskEvent.java index b3988762..51ac3497 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskEvent.java @@ -1,11 +1,9 @@ package net.chrisrichardson.eventstore.examples.kanban.common.task.event; -import net.chrisrichardson.eventstore.Event; -import net.chrisrichardson.eventstore.EventEntity; -/** - * Created by popikyardo on 20.10.15. - */ +import io.eventuate.Event; +import io.eventuate.EventEntity; + @EventEntity(entity="net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskAggregate") public abstract class TaskEvent implements Event { } diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskScheduledEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskScheduledEvent.java index bda302e2..cb9aa4c4 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskScheduledEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskScheduledEvent.java @@ -5,9 +5,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.task.event.TaskEvent; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by Main on 17.10.2015. - */ public class TaskScheduledEvent extends TaskEvent implements DetailedTaskEvent { private String boardId; private AuditEntry update; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskStartedEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskStartedEvent.java index aed4e8df..5dbe6667 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskStartedEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskStartedEvent.java @@ -5,9 +5,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.task.event.TaskEvent; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by Main on 17.10.2015. - */ public class TaskStartedEvent extends TaskEvent implements DetailedTaskEvent { private String boardId; private AuditEntry update; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskUpdatedEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskUpdatedEvent.java index eadcde36..f5844728 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskUpdatedEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskUpdatedEvent.java @@ -5,9 +5,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.task.event.TaskEvent; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by popikyardo on 21.09.15. - */ public class TaskUpdatedEvent extends TaskEvent { private TaskDetails taskDetails; private AuditEntry update; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/BacklogResponse.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/BacklogResponse.java index 05847d81..010cdc3a 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/BacklogResponse.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/BacklogResponse.java @@ -2,9 +2,6 @@ import java.util.List; -/** - * Created by popikyardo on 23.10.15. - */ public class BacklogResponse { private List tasks; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/ChangeTaskStatusRequest.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/ChangeTaskStatusRequest.java index 7ccd9e9d..e24513e6 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/ChangeTaskStatusRequest.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/ChangeTaskStatusRequest.java @@ -1,8 +1,5 @@ package net.chrisrichardson.eventstore.examples.kanban.common.task.model; -/** - * Created by popikyardo on 08.01.16. - */ public class ChangeTaskStatusRequest { private String boardId; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/HistoryEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/HistoryEvent.java index e9d0840d..c5f16f4c 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/HistoryEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/HistoryEvent.java @@ -1,11 +1,8 @@ package net.chrisrichardson.eventstore.examples.kanban.common.task.model; -import net.chrisrichardson.eventstore.Event; +import io.eventuate.Event; -/** - * Created by popikyardo on 05.11.15. - */ public class HistoryEvent { private String id; private String eventType; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/HistoryResponse.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/HistoryResponse.java index 0443d8cb..107d4a33 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/HistoryResponse.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/HistoryResponse.java @@ -2,9 +2,6 @@ import java.util.List; -/** - * Created by popikyardo on 21.12.15. - */ public class HistoryResponse { private List data; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/Task.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/Task.java index 5ef153ac..22f51e59 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/Task.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/Task.java @@ -8,9 +8,6 @@ import java.util.Date; -/** - * Created by popikyardo on 15.10.15. - */ public class Task { @Id private String id; diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/TaskResponse.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/TaskResponse.java index f47cf5aa..e311c91e 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/TaskResponse.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/model/TaskResponse.java @@ -6,9 +6,6 @@ import java.util.Date; -/** - * Created by popikyardo on 15.10.15. - */ public class TaskResponse { private String id; diff --git a/java-server/common-web/build.gradle b/java-server/common-web/build.gradle index 1c3a174f..2ec5d355 100755 --- a/java-server/common-web/build.gradle +++ b/java-server/common-web/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'java' dependencies { - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" testCompile "junit:junit:4.11" diff --git a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/WebConfiguration.java b/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/WebConfiguration.java index 15005a79..c0781694 100755 --- a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/WebConfiguration.java +++ b/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/WebConfiguration.java @@ -1,34 +1,16 @@ package net.chrisrichardson.eventstore.examples.kanban.commonweb; -import net.chrisrichardson.eventstore.examples.kanban.commonweb.util.ObservableReturnValueHandler; import org.springframework.boot.context.embedded.ServletListenerRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.context.request.RequestContextListener; -import org.springframework.web.method.support.HandlerMethodReturnValueHandler; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter; - -import java.util.ArrayList; -import java.util.List; @Configuration @ComponentScan("net.chrisrichardson.eventstore.examples.kanban.commonweb") public class WebConfiguration extends WebMvcConfigurerAdapter { - class FakeThing { - } - - @Bean - public FakeThing init(RequestMappingHandlerAdapter adapter) { - // https://jira.spring.io/browse/SPR-13083 - List handlers = new ArrayList(adapter.getReturnValueHandlers()); - handlers.add(0, new ObservableReturnValueHandler()); - adapter.setReturnValueHandlers(handlers); - return new FakeThing(); - } - @Bean public ServletListenerRegistrationBean httpRequestContextListener() { return new ServletListenerRegistrationBean(new RequestContextListener()); diff --git a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/filter/CORSFilter.java b/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/filter/CORSFilter.java index 09cd5027..ec176d14 100755 --- a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/filter/CORSFilter.java +++ b/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/filter/CORSFilter.java @@ -7,9 +7,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; -/** - * Created by popikyardo on 21.09.15. - */ @Component public class CORSFilter implements Filter { diff --git a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/DeferredUtils.java b/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/DeferredUtils.java deleted file mode 100755 index 1e34a259..00000000 --- a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/DeferredUtils.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.commonweb.util; - -import org.springframework.web.context.request.async.DeferredResult; -import rx.Observable; -import rx.Subscriber; - -import java.util.concurrent.atomic.AtomicReference; - -public class DeferredUtils { - - public static DeferredResult toDeferredResult(Observable o) { - final DeferredResult d = new DeferredResult(); - final AtomicReference r = new AtomicReference(); - - try { - o.single().subscribe(new Subscriber() { - @Override - public void onCompleted() { - d.setResult(r.get()); - } - - @Override - public void onError(Throwable e) { - d.setErrorResult(e); - } - - @Override - public void onNext(T t) { - r.set(t); - } - }); - } catch (Exception e) { - d.setErrorResult(e); - } - return d; - } -} diff --git a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/HttpExceptionHandler.java b/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/HttpExceptionHandler.java index 5e15014e..3b4379b9 100755 --- a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/HttpExceptionHandler.java +++ b/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/HttpExceptionHandler.java @@ -11,9 +11,6 @@ import javax.servlet.http.HttpServletResponse; import java.util.NoSuchElementException; -/** - * Created by popikyardo on 07.12.15. - */ @ControllerAdvice public class HttpExceptionHandler { private static final Logger logger = LoggerFactory.getLogger(HttpExceptionHandler.class); diff --git a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/ObservableReturnValueHandler.java b/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/ObservableReturnValueHandler.java deleted file mode 100755 index 2ccefb84..00000000 --- a/java-server/common-web/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonweb/util/ObservableReturnValueHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.commonweb.util; - -import org.springframework.core.MethodParameter; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.context.request.async.DeferredResult; -import org.springframework.web.context.request.async.WebAsyncUtils; -import org.springframework.web.method.support.HandlerMethodReturnValueHandler; -import org.springframework.web.method.support.ModelAndViewContainer; -import rx.Observable; - - -public class ObservableReturnValueHandler implements HandlerMethodReturnValueHandler { - - @Override - public boolean supportsReturnType(MethodParameter returnType) { - return Observable.class.equals(returnType.getParameterType()); - } - - @Override - public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, - NativeWebRequest webRequest) throws Exception { - - if (returnValue == null) { - return; - } - DeferredResult d = DeferredUtils.toDeferredResult((Observable) returnValue); - WebAsyncUtils.getAsyncManager(webRequest).startDeferredResultProcessing(d, mavContainer); - } - -} diff --git a/java-server/common-websocket/build.gradle b/java-server/common-websocket/build.gradle index c06c92c9..9195b16b 100755 --- a/java-server/common-websocket/build.gradle +++ b/java-server/common-websocket/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'java' dependencies { compile project(":common-board") compile project(":common-task") - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.security:spring-security-config:4.0.2.RELEASE" diff --git a/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebSocketConfig.java b/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebSocketConfig.java index 73422f9d..d3fea458 100755 --- a/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebSocketConfig.java +++ b/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebSocketConfig.java @@ -1,25 +1,19 @@ package net.chrisrichardson.eventstore.examples.kanban.commonwebsocket; -import net.chrisrichardson.eventstore.javaapi.consumer.EnableJavaEventHandlers; -import net.chrisrichardson.eventstore.subscriptions.config.EventStoreSubscriptionsConfiguration; +import io.eventuate.javaclient.spring.EnableEventHandlers; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; import org.springframework.messaging.simp.config.MessageBrokerRegistry; import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer; import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; import org.springframework.web.socket.config.annotation.StompEndpointRegistry; -/** - * Created by popikyardo on 08.10.15. - */ @Configuration -@Import({EventStoreSubscriptionsConfiguration.class}) @EnableAutoConfiguration @ComponentScan("net.chrisrichardson.eventstore.examples.kanban.commonwebsocket") @EnableWebSocketMessageBroker -@EnableJavaEventHandlers +@EnableEventHandlers public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer { @Override diff --git a/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebSocketSecurityConfig.java b/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebSocketSecurityConfig.java index ff19d3eb..4062970c 100755 --- a/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebSocketSecurityConfig.java +++ b/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebSocketSecurityConfig.java @@ -4,9 +4,6 @@ import org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry; import org.springframework.security.config.annotation.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurer; -/** - * Created by popikyardo on 13.10.15. - */ @Configuration public class WebSocketSecurityConfig extends AbstractSecurityWebSocketMessageBrokerConfigurer { diff --git a/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebsocketEventsTranslator.java b/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebsocketEventsTranslator.java index d524ad5c..59acc3f4 100755 --- a/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebsocketEventsTranslator.java +++ b/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/WebsocketEventsTranslator.java @@ -3,27 +3,22 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import net.chrisrichardson.eventstore.Event; +import io.eventuate.DispatchedEvent; +import io.eventuate.Event; +import io.eventuate.EventHandlerMethod; +import io.eventuate.EventSubscriber; import net.chrisrichardson.eventstore.examples.kanban.common.board.event.BoardCreatedEvent; import net.chrisrichardson.eventstore.examples.kanban.common.board.model.Board; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskStatus; import net.chrisrichardson.eventstore.examples.kanban.common.task.event.*; import net.chrisrichardson.eventstore.examples.kanban.common.task.model.Task; import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.model.KanbanWebSocketEvent; -import net.chrisrichardson.eventstore.subscriptions.CompoundEventHandler; -import net.chrisrichardson.eventstore.subscriptions.DispatchedEvent; -import net.chrisrichardson.eventstore.subscriptions.EventHandlerMethod; -import net.chrisrichardson.eventstore.subscriptions.EventSubscriber; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.messaging.simp.SimpMessagingTemplate; -import rx.Observable; -/** - * Created by popikyardo on 15.10.15. - */ @EventSubscriber(id="websocketEventHandlers") -public class WebsocketEventsTranslator implements CompoundEventHandler { +public class WebsocketEventsTranslator { protected SimpMessagingTemplate template; @@ -39,106 +34,104 @@ public WebsocketEventsTranslator(SimpMessagingTemplate template) { } @EventHandlerMethod - public Observable sendBoardEvents(DispatchedEvent de) throws JsonProcessingException { + public void sendBoardEvents(DispatchedEvent de) throws JsonProcessingException { Board board = new Board(); - board.setId(de.getEntityIdentifier().getId()); - board.setTitle(de.event().getBoardInfo().getTitle()); - board.setCreatedBy(de.event().getBoardInfo().getCreation().getWho()); - board.setCreatedDate(de.event().getBoardInfo().getCreation().getWhen()); - board.setUpdatedBy(de.event().getBoardInfo().getUpdate().getWho()); - board.setUpdatedDate(de.event().getBoardInfo().getUpdate().getWhen()); - - return this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(board)); + board.setId(de.getEntityId()); + board.setTitle(de.getEvent().getBoardInfo().getTitle()); + board.setCreatedBy(de.getEvent().getBoardInfo().getCreation().getWho()); + board.setCreatedDate(de.getEvent().getBoardInfo().getCreation().getWhen()); + board.setUpdatedBy(de.getEvent().getBoardInfo().getUpdate().getWho()); + board.setUpdatedDate(de.getEvent().getBoardInfo().getUpdate().getWhen()); + + this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(board)); } @EventHandlerMethod - public Observable sendTaskCreatedEvent(DispatchedEvent de) throws JsonProcessingException { - Task task = Task.transform(de.getEntityIdentifier().getId(), de.event().getTaskInfo()); - return this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); + public void sendTaskCreatedEvent(DispatchedEvent de) throws JsonProcessingException { + Task task = Task.transform(de.getEntityId(), de.getEvent().getTaskInfo()); + this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); } @EventHandlerMethod - public Observable sendTaskMovedToBacklogEvent(DispatchedEvent de) throws JsonProcessingException { + public void sendTaskMovedToBacklogEvent(DispatchedEvent de) throws JsonProcessingException { Task task = new Task(); - task.setId(de.getEntityIdentifier().getId()); - task.setUpdatedBy(de.event().getUpdate().getWho()); - task.setUpdatedDate(de.event().getUpdate().getWhen()); + task.setId(de.getEntityId()); + task.setUpdatedBy(de.getEvent().getUpdate().getWho()); + task.setUpdatedDate(de.getEvent().getUpdate().getWhen()); task.setBoardId(""); task.setStatus(TaskStatus.backlog); - return this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); + this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); } @EventHandlerMethod - public Observable sendTaskCompletedEvent(DispatchedEvent de) throws JsonProcessingException { + public void sendTaskCompletedEvent(DispatchedEvent de) throws JsonProcessingException { Task task = new Task(); - task.setId(de.getEntityIdentifier().getId()); - task.setBoardId(de.event().getBoardId()); - task.setUpdatedBy(de.event().getUpdate().getWho()); - task.setUpdatedDate(de.event().getUpdate().getWhen()); + task.setId(de.getEntityId()); + task.setBoardId(de.getEvent().getBoardId()); + task.setUpdatedBy(de.getEvent().getUpdate().getWho()); + task.setUpdatedDate(de.getEvent().getUpdate().getWhen()); task.setStatus(TaskStatus.completed); - return this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); + this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); } @EventHandlerMethod - public Observable sendTaskDeletedEvent(DispatchedEvent de) throws JsonProcessingException { + public void sendTaskDeletedEvent(DispatchedEvent de) throws JsonProcessingException { Task task = new Task(); - task.setId(de.getEntityIdentifier().getId()); - task.setUpdatedBy(de.event().getUpdate().getWho()); - task.setUpdatedDate(de.event().getUpdate().getWhen()); + task.setId(de.getEntityId()); + task.setUpdatedBy(de.getEvent().getUpdate().getWho()); + task.setUpdatedDate(de.getEvent().getUpdate().getWhen()); task.setDeleted(true); - return this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); + this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); } @EventHandlerMethod - public Observable sendTaskScheduledEvent(DispatchedEvent de) throws JsonProcessingException { + public void sendTaskScheduledEvent(DispatchedEvent de) throws JsonProcessingException { Task task = new Task(); - task.setId(de.getEntityIdentifier().getId()); - task.setBoardId(de.event().getBoardId()); - task.setUpdatedBy(de.event().getUpdate().getWho()); - task.setUpdatedDate(de.event().getUpdate().getWhen()); + task.setId(de.getEntityId()); + task.setBoardId(de.getEvent().getBoardId()); + task.setUpdatedBy(de.getEvent().getUpdate().getWho()); + task.setUpdatedDate(de.getEvent().getUpdate().getWhen()); task.setStatus(TaskStatus.scheduled); - return this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); + this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); } @EventHandlerMethod - public Observable sendTaskStartedEvent(DispatchedEvent de) throws JsonProcessingException { + public void sendTaskStartedEvent(DispatchedEvent de) throws JsonProcessingException { Task task = new Task(); - task.setId(de.getEntityIdentifier().getId()); - task.setBoardId(de.event().getBoardId()); - task.setUpdatedBy(de.event().getUpdate().getWho()); - task.setUpdatedDate(de.event().getUpdate().getWhen()); + task.setId(de.getEntityId()); + task.setBoardId(de.getEvent().getBoardId()); + task.setUpdatedBy(de.getEvent().getUpdate().getWho()); + task.setUpdatedDate(de.getEvent().getUpdate().getWhen()); task.setStatus(TaskStatus.started); - return this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); + this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); } @EventHandlerMethod - public Observable sendTaskUpdatedEvent(DispatchedEvent de) throws JsonProcessingException { + public void sendTaskUpdatedEvent(DispatchedEvent de) throws JsonProcessingException { Task task = new Task(); - task.setId(de.getEntityIdentifier().getId()); - task.setTitle(de.event().getTaskDetails().getTitle()); - task.setDescription(de.event().getTaskDetails().getDescription() != null ? - de.event().getTaskDetails().getDescription().getDescription() : null); - task.setUpdatedBy(de.event().getUpdate().getWho()); - task.setUpdatedDate(de.event().getUpdate().getWhen()); - - return this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); + task.setId(de.getEntityId()); + task.setTitle(de.getEvent().getTaskDetails().getTitle()); + task.setDescription(de.getEvent().getTaskDetails().getDescription() != null ? + de.getEvent().getTaskDetails().getDescription().getDescription() : null); + task.setUpdatedBy(de.getEvent().getUpdate().getWho()); + task.setUpdatedDate(de.getEvent().getUpdate().getWhen()); + + this.sendEvent(de, DESTINATION_DEFAULT_URL, objectMapper.writeValueAsString(task)); } - private Observable sendEvent(DispatchedEvent de, String destination, String eventData) throws JsonProcessingException { - log.info("Sending board event to websocket : {}", de.event()); + private void sendEvent(DispatchedEvent de, String destination, String eventData) throws JsonProcessingException { + log.info("Sending board event to websocket : {}", de.getEvent()); KanbanWebSocketEvent event = new KanbanWebSocketEvent(); - event.setEntityId(de.entityId().id()); + event.setEntityId(de.getEntityId()); event.setEventData(eventData); - event.setEventId(de.eventId().asString()); - event.setEventType(de.eventType()); + event.setEventId(de.getEventId().asString()); + event.setEventType(de.getEventType().getName()); template.convertAndSend(destination, objectMapper.writeValueAsString(event)); - - return Observable.just(null); } } \ No newline at end of file diff --git a/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/model/KanbanWebSocketEvent.java b/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/model/KanbanWebSocketEvent.java index ff7ee2a3..ae2f8775 100755 --- a/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/model/KanbanWebSocketEvent.java +++ b/java-server/common-websocket/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commonwebsocket/model/KanbanWebSocketEvent.java @@ -3,9 +3,6 @@ import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by popikyardo on 20.10.15. - */ public class KanbanWebSocketEvent { private String eventId; diff --git a/java-server/common/build.gradle b/java-server/common/build.gradle index 293b65f8..18632567 100755 --- a/java-server/common/build.gradle +++ b/java-server/common/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'java' dependencies { - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" testCompile "junit:junit:4.11" } diff --git a/java-server/common/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/model/AuditEntry.java b/java-server/common/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/model/AuditEntry.java index b1a0ae84..045b6cec 100755 --- a/java-server/common/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/model/AuditEntry.java +++ b/java-server/common/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/model/AuditEntry.java @@ -6,9 +6,6 @@ import java.util.Date; -/** - * Created by popikyardo on 11.01.16. - */ public class AuditEntry { private String who; diff --git a/java-server/e2e-test/build.gradle b/java-server/e2e-test/build.gradle index 47f272ef..8ed7cff4 100755 --- a/java-server/e2e-test/build.gradle +++ b/java-server/e2e-test/build.gradle @@ -6,7 +6,7 @@ dependencies { testCompile "junit:junit:4.11" testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion" + testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" } test { diff --git a/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/AuthControllerTest.java b/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/AuthControllerTest.java index a6722338..43824623 100755 --- a/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/AuthControllerTest.java +++ b/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/AuthControllerTest.java @@ -5,9 +5,6 @@ import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.test.context.web.WebAppConfiguration; -/** - * Created by popikyardo on 23.09.15. - */ @SpringApplicationConfiguration(classes = {E2ETestConfiguration.class}) @WebAppConfiguration public class AuthControllerTest extends AbstractAuthTest { diff --git a/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/E2ETestConfiguration.java b/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/E2ETestConfiguration.java index 90a2af0e..d69116d8 100755 --- a/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/E2ETestConfiguration.java +++ b/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/E2ETestConfiguration.java @@ -1,9 +1,9 @@ package net.chrisrichardson.eventstore.examples.kanban.e2etest; import com.fasterxml.jackson.databind.ObjectMapper; +import io.eventuate.javaclient.spring.jdbc.EventuateJdbcEventStoreConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebsocketEventsTranslator; import net.chrisrichardson.eventstore.examples.kanban.testutil.BasicWebTestConfiguration; -import net.chrisrichardson.eventstore.jdbc.config.JdbcEventStoreConfiguration; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; import org.springframework.context.annotation.Bean; @@ -19,12 +19,9 @@ import java.util.Collections; -/** - * Created by popikyardo on 23.09.15. - */ @Configuration @EnableWebSecurity -@Import({JdbcEventStoreConfiguration.class, BasicWebTestConfiguration.class}) +@Import({EventuateJdbcEventStoreConfiguration.class, BasicWebTestConfiguration.class}) public class E2ETestConfiguration { @Bean diff --git a/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/RestApiTest.java b/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/RestApiTest.java index 3de37b12..aecc0fa8 100755 --- a/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/RestApiTest.java +++ b/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/RestApiTest.java @@ -10,9 +10,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; -/** - * Created by popikyardo on 07.01.16. - */ @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @SpringApplicationConfiguration(classes = {E2ETestConfiguration.class}) diff --git a/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/StompApiTest.java b/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/StompApiTest.java index 5aa58cf6..a88b03db 100755 --- a/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/StompApiTest.java +++ b/java-server/e2e-test/src/test/java/net/chrisrichardson/eventstore/examples/kanban/e2etest/StompApiTest.java @@ -11,13 +11,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; - - -/** - * Created by Main on 06.10.2015. - */ - - @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @SpringApplicationConfiguration(classes = {E2ETestConfiguration.class}) diff --git a/java-server/gradle.properties b/java-server/gradle.properties index 6d21c2b8..e53bd610 100755 --- a/java-server/gradle.properties +++ b/java-server/gradle.properties @@ -1,8 +1,7 @@ - org.gradle.jvmargs=-XX:MaxPermSize=512m eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release -eventStoreClientVersion=0.12 -springBootVersion=1.2.8.RELEASE -springVersion=4.1.9.RELEASE +eventuateClientVersion=0.2.0.RELEASE +springBootVersion=1.3.5.RELEASE +springVersion=4.1.9.RELEASE \ No newline at end of file diff --git a/java-server/rest-api-integration-tests/build.gradle b/java-server/rest-api-integration-tests/build.gradle index 16171549..4034ea48 100755 --- a/java-server/rest-api-integration-tests/build.gradle +++ b/java-server/rest-api-integration-tests/build.gradle @@ -10,5 +10,5 @@ dependencies { testCompile "junit:junit:4.11" testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" - testCompile "net.chrisrichardson.eventstore.client:eventstore-jdbc_2.10:$eventStoreClientVersion" + testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" } diff --git a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/AuthControllerTest.java b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/AuthControllerTest.java index 9e5ade3f..932e74a9 100755 --- a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/AuthControllerTest.java +++ b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/AuthControllerTest.java @@ -5,9 +5,6 @@ import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.test.context.web.WebAppConfiguration; -/** - * Created by popikyardo on 23.09.15. - */ @SpringApplicationConfiguration(classes = {RestAPITestConfiguration.class}) @WebAppConfiguration public class AuthControllerTest extends AbstractAuthTest { diff --git a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java index 7d3e8d62..45516568 100755 --- a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java +++ b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java @@ -1,13 +1,13 @@ package net.chrisrichardson.eventstore.examples.kanban.integrationtests; import com.fasterxml.jackson.databind.ObjectMapper; +import io.eventuate.javaclient.spring.jdbc.EventuateJdbcEventStoreConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebsocketEventsTranslator; import net.chrisrichardson.eventstore.examples.kanban.queryside.board.BoardQuerySideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.queryside.task.TaskQuerySideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.testutil.BasicWebTestConfiguration; -import net.chrisrichardson.eventstore.jdbc.config.JdbcEventStoreConfiguration; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; import org.springframework.context.annotation.Bean; @@ -20,15 +20,11 @@ import org.springframework.messaging.simp.SimpMessagingTemplate; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.web.client.RestTemplate; - import java.util.Collections; -/** - * Created by popikyardo on 23.09.15. - */ @Configuration @EnableWebSecurity -@Import({JdbcEventStoreConfiguration.class, BasicWebTestConfiguration.class, BoardQuerySideConfiguration.class, TaskQuerySideConfiguration.class, BoardCommandSideConfiguration.class, TaskCommandSideConfiguration.class}) +@Import({EventuateJdbcEventStoreConfiguration.class, BasicWebTestConfiguration.class, BoardQuerySideConfiguration.class, TaskQuerySideConfiguration.class, BoardCommandSideConfiguration.class, TaskCommandSideConfiguration.class}) public class RestAPITestConfiguration { @Bean diff --git a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestApiTest.java b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestApiTest.java index a8ca5b68..415b0ee3 100755 --- a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestApiTest.java +++ b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestApiTest.java @@ -10,9 +10,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; -/** - * Created by popikyardo on 07.01.16. - */ @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @SpringApplicationConfiguration(classes = {RestAPITestConfiguration.class}) diff --git a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/StompApiTest.java b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/StompApiTest.java index 067d607c..235d2ef5 100755 --- a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/StompApiTest.java +++ b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/StompApiTest.java @@ -11,11 +11,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; - -/** - * Created by Main on 06.10.2015. - */ - @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @SpringApplicationConfiguration(classes = {RestAPITestConfiguration.class}) diff --git a/java-server/standalone-service/build.gradle b/java-server/standalone-service/build.gradle index e590d590..5a10c42b 100755 --- a/java-server/standalone-service/build.gradle +++ b/java-server/standalone-service/build.gradle @@ -11,8 +11,8 @@ dependencies { compile project(":common-websocket") compile project(":common-swagger") - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" - compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" @@ -26,8 +26,8 @@ test { } task copyAngularJS(type: Copy) { - from "../../prebuilt-angularjs-client" - into "build/resources/main/static" + from "../../prebuilt-angularjs-client" + into "build/resources/main/static" } jar.dependsOn(copyAngularJS) diff --git a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java b/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java index 9620be38..5c88b837 100755 --- a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java +++ b/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java @@ -1,6 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.standalone; -import net.chrisrichardson.eventstore.client.config.EventStoreHttpClientConfiguration; +import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; @@ -17,11 +17,8 @@ import org.springframework.context.annotation.Import; import org.springframework.messaging.simp.SimpMessagingTemplate; -/** - * Created by Main on 06.10.2015. - */ @Configuration -@Import({EventStoreHttpClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class, BoardQuerySideConfiguration.class, TaskQuerySideConfiguration.class, BoardCommandSideConfiguration.class, TaskCommandSideConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class, BoardQuerySideConfiguration.class, TaskQuerySideConfiguration.class, BoardCommandSideConfiguration.class, TaskCommandSideConfiguration.class, CommonSwaggerConfiguration.class}) @ComponentScan public class StandaloneServiceConfiguration { @Bean diff --git a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/main/StandaloneServiceMain.java b/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/main/StandaloneServiceMain.java index 552b7a11..b9d4eb1a 100755 --- a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/main/StandaloneServiceMain.java +++ b/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/main/StandaloneServiceMain.java @@ -3,10 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.standalone.StandaloneServiceConfiguration; import org.springframework.boot.SpringApplication; -/** - * Created by Main on 06.10.2015. - */ - public class StandaloneServiceMain { public static void main(String[] args) { SpringApplication.run(StandaloneServiceConfiguration.class, args); diff --git a/java-server/task-command-side-service/build.gradle b/java-server/task-command-side-service/build.gradle index f0aafd0f..e1a8b6c1 100755 --- a/java-server/task-command-side-service/build.gradle +++ b/java-server/task-command-side-service/build.gradle @@ -9,6 +9,6 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" testCompile "junit:junit:4.11" } \ No newline at end of file diff --git a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java b/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java index 783dcc8f..fd2357f5 100755 --- a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java +++ b/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java @@ -1,6 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.taskcommandsideservice; -import net.chrisrichardson.eventstore.client.config.EventStoreHttpClientConfiguration; +import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; @@ -10,11 +10,9 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -/** - * Created by Main on 19.01.2016. - */ + @Configuration -@Import({TaskCommandSideConfiguration.class, EventStoreHttpClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({TaskCommandSideConfiguration.class, EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class TaskCommandSideServiceConfiguration { diff --git a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/main/TaskCommandSideServiceMain.java b/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/main/TaskCommandSideServiceMain.java index 0975abb2..9827748c 100755 --- a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/main/TaskCommandSideServiceMain.java +++ b/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/main/TaskCommandSideServiceMain.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.taskcommandsideservice.TaskCommandSideServiceConfiguration; import org.springframework.boot.SpringApplication; -/** - * Created by Main on 19.01.2016. - */ public class TaskCommandSideServiceMain { public static void main(String[] args) { SpringApplication.run(TaskCommandSideServiceConfiguration.class, args); diff --git a/java-server/task-command-side/build.gradle b/java-server/task-command-side/build.gradle index 52ff84ea..a53b3831 100755 --- a/java-server/task-command-side/build.gradle +++ b/java-server/task-command-side/build.gradle @@ -5,7 +5,7 @@ dependencies { compile project(":common-web") compile project(":common-auth") - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CompleteTaskCommand.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CompleteTaskCommand.java index 2cc31d73..f8af8344 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CompleteTaskCommand.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CompleteTaskCommand.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by Main on 17.10.2015. - */ public class CompleteTaskCommand implements TaskCommand { private String boardId; private AuditEntry update; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CreateTaskCommand.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CreateTaskCommand.java index c1c1658c..f8a670e1 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CreateTaskCommand.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CreateTaskCommand.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskInfo; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by popikyardo on 15.10.15. - */ public class CreateTaskCommand implements TaskCommand { private TaskInfo taskInfo; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/DeleteTaskCommand.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/DeleteTaskCommand.java index a520cc76..e847ec7b 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/DeleteTaskCommand.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/DeleteTaskCommand.java @@ -2,9 +2,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; -/** - * Created by Main on 17.10.2015. - */ public class DeleteTaskCommand implements TaskCommand { private AuditEntry update; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/MoveToBacklogTaskCommand.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/MoveToBacklogTaskCommand.java index c36bb36f..670c7b34 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/MoveToBacklogTaskCommand.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/MoveToBacklogTaskCommand.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by Main on 17.10.2015. - */ public class MoveToBacklogTaskCommand implements TaskCommand { private AuditEntry update; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/ScheduleTaskCommand.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/ScheduleTaskCommand.java index 8ce03ad1..a8ca4f6a 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/ScheduleTaskCommand.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/ScheduleTaskCommand.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by Main on 17.10.2015. - */ public class ScheduleTaskCommand implements TaskCommand { private String boardId; private AuditEntry update; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/StartTaskCommand.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/StartTaskCommand.java index b9044315..fb571200 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/StartTaskCommand.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/StartTaskCommand.java @@ -3,9 +3,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by Main on 17.10.2015. - */ public class StartTaskCommand implements TaskCommand { private String boardId; private AuditEntry update; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskAggregate.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskAggregate.java index 7c6a0bb3..86f3d8f0 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskAggregate.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskAggregate.java @@ -1,8 +1,8 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.task; -import net.chrisrichardson.eventstore.Event; -import net.chrisrichardson.eventstore.EventUtil; -import net.chrisrichardson.eventstore.ReflectiveMutableCommandProcessingAggregate; +import io.eventuate.Event; +import io.eventuate.EventUtil; +import io.eventuate.ReflectiveMutableCommandProcessingAggregate; import net.chrisrichardson.eventstore.examples.kanban.common.task.*; import net.chrisrichardson.eventstore.examples.kanban.common.task.event.*; import org.slf4j.Logger; @@ -10,9 +10,6 @@ import java.util.List; -/** - * Created by popikyardo on 21.09.15. - */ public class TaskAggregate extends ReflectiveMutableCommandProcessingAggregate { private TaskInfo task; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommand.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommand.java index cdc63fc7..03fc88e0 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommand.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommand.java @@ -1,9 +1,7 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.task; -import net.chrisrichardson.eventstore.Command; -/** - * Created by popikyardo on 21.09.15. - */ +import io.eventuate.Command; + public interface TaskCommand extends Command { } diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandController.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandController.java index e2e87c56..bbc553a5 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandController.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandController.java @@ -1,6 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.task; -import net.chrisrichardson.eventstore.EntityWithIdAndVersion; +import io.eventuate.EntityWithIdAndVersion; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskDetails; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskInfo; import net.chrisrichardson.eventstore.examples.kanban.common.task.model.ChangeTaskStatusRequest; @@ -16,15 +16,12 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import rx.Observable; +import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; import static org.springframework.web.bind.annotation.RequestMethod.*; -/** - * Created by Main on 02.10.2015. - */ @RestController @RequestMapping(value = "/api") public class TaskCommandController { @@ -37,48 +34,48 @@ public class TaskCommandController { private static Logger log = LoggerFactory.getLogger(TaskCommandController.class); @RequestMapping(value = "/tasks", method = POST) - public Observable saveTask(@RequestBody TaskInfo task) { - return taskService.save(task).map(this::makeTaskResponse); + public CompletableFuture saveTask(@RequestBody TaskInfo task) { + return taskService.save(task).thenApply(this::makeTaskResponse); } @RequestMapping(value = "/tasks/{id}", method = DELETE) - public Observable deleteTask(@PathVariable("id") String taskId) { - return taskService.remove(taskId, getCurrentUser()).map(this::makeTaskResponse); + public CompletableFuture deleteTask(@PathVariable("id") String taskId) { + return taskService.remove(taskId, getCurrentUser()).thenApply(this::makeTaskResponse); } @RequestMapping(value = "/tasks/{id}", method = PUT) - public Observable updateTask(@PathVariable("id") String taskId, - @RequestBody TaskDetails request) { - return taskService.update(taskId, request, getCurrentUser()).map(this::makeTaskResponse); + public CompletableFuture updateTask(@PathVariable("id") String taskId, + @RequestBody TaskDetails request) { + return taskService.update(taskId, request, getCurrentUser()).thenApply(this::makeTaskResponse); } @RequestMapping(value = "/tasks/{id}/start", method = PUT) - public Observable startTask(@PathVariable("id") String taskId, @RequestBody ChangeTaskStatusRequest request) { - return taskService.startTask(taskId, request.getBoardId(), getCurrentUser()).map(this::makeTaskResponse); + public CompletableFuture startTask(@PathVariable("id") String taskId, @RequestBody ChangeTaskStatusRequest request) { + return taskService.startTask(taskId, request.getBoardId(), getCurrentUser()).thenApply(this::makeTaskResponse); } @RequestMapping(value = "/tasks/{id}/schedule", method = PUT) - public Observable scheduleTask(@PathVariable("id") String taskId, @RequestBody ChangeTaskStatusRequest request) { - return taskService.scheduleTask(taskId, request.getBoardId(), getCurrentUser()).map(this::makeTaskResponse); + public CompletableFuture scheduleTask(@PathVariable("id") String taskId, @RequestBody ChangeTaskStatusRequest request) { + return taskService.scheduleTask(taskId, request.getBoardId(), getCurrentUser()).thenApply(this::makeTaskResponse); } @RequestMapping(value = "/tasks/{id}/complete", method = PUT) - public Observable completeTask(@PathVariable("id") String taskId, @RequestBody ChangeTaskStatusRequest request) { - return taskService.completeTask(taskId, request.getBoardId(), getCurrentUser()).map(this::makeTaskResponse); + public CompletableFuture completeTask(@PathVariable("id") String taskId, @RequestBody ChangeTaskStatusRequest request) { + return taskService.completeTask(taskId, request.getBoardId(), getCurrentUser()).thenApply(this::makeTaskResponse); } @RequestMapping(value = "/tasks/{id}/backlog", method = PUT) - public Observable backlogTask(@PathVariable("id") String taskId) { - return taskService.backlogTask(taskId, getCurrentUser()).map(this::makeTaskResponse); + public CompletableFuture backlogTask(@PathVariable("id") String taskId) { + return taskService.backlogTask(taskId, getCurrentUser()).thenApply(this::makeTaskResponse); } @RequestMapping(value = "/tasks/{id}/history", method = GET) - public Observable getHistory(@PathVariable("id") String taskId) { - return taskHistoryService.getHistoryEvents(taskId).map(ewm -> { - log.info("Getting Task History {}", ewm.entity().getTask()); + public CompletableFuture getHistory(@PathVariable("id") String taskId) { + return taskHistoryService.getHistoryEvents(taskId).thenApply(ewm -> { + log.info("Getting Task History {}", ewm.getEntity().getTask()); return new HistoryResponse(ewm.getEvents().stream().map(e -> { HistoryEvent res = new HistoryEvent(); - res.setId(ewm.entityId().id()); + res.setId(ewm.getEntityIdAndVersion().getEntityId()); res.setEventType(e.getClass().getCanonicalName()); res.setEventData(e); return res; @@ -92,16 +89,16 @@ private String getCurrentUser() { } private TaskResponse makeTaskResponse(EntityWithIdAndVersion e) { - return new TaskResponse(e.getEntityIdentifier().getId(), - e.entity().getTask().getBoardId(), - e.entity().getTask().getTaskDetails().getTitle(), - e.entity().getTask().getCreation().getWho(), - e.entity().getTask().getUpdate().getWho(), - e.entity().getTask().getCreation().getWhen(), - e.entity().getTask().getUpdate().getWhen(), - e.entity().getTask().getStatus(), - e.entity().getTask().isDeleted(), - e.entity().getTask().getTaskDetails().getDescription() + return new TaskResponse(e.getEntityId(), + e.getAggregate().getTask().getBoardId(), + e.getAggregate().getTask().getTaskDetails().getTitle(), + e.getAggregate().getTask().getCreation().getWho(), + e.getAggregate().getTask().getUpdate().getWho(), + e.getAggregate().getTask().getCreation().getWhen(), + e.getAggregate().getTask().getUpdate().getWhen(), + e.getAggregate().getTask().getStatus(), + e.getAggregate().getTask().isDeleted(), + e.getAggregate().getTask().getTaskDetails().getDescription() ); } } diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandSideConfiguration.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandSideConfiguration.java index d88e5cf8..f5304f8b 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandSideConfiguration.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandSideConfiguration.java @@ -1,26 +1,25 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.task; -import net.chrisrichardson.eventstore.EventStore; -import net.chrisrichardson.eventstore.repository.AggregateRepository; -import net.chrisrichardson.eventstore.subscriptions.config.EventStoreSubscriptionsConfiguration; +import io.eventuate.AggregateRepository; +import io.eventuate.EventuateAggregateStore; +import io.eventuate.javaclient.spring.EnableEventHandlers; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration; import org.springframework.boot.autoconfigure.web.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; @Configuration -@Import({EventStoreSubscriptionsConfiguration.class}) @EnableAutoConfiguration(exclude = {MongoRepositoriesAutoConfiguration.class}) @ComponentScan +@EnableEventHandlers public class TaskCommandSideConfiguration { @Bean - public AggregateRepository taskAggregateRepository(EventStore eventStore) { + public AggregateRepository taskAggregateRepository(EventuateAggregateStore eventStore) { return new AggregateRepository<>(TaskAggregate.class, eventStore); } @@ -30,7 +29,7 @@ public TaskService taskService(AggregateRepository t } @Bean - public TaskHistoryService taskHistoryService(EventStore eventStore) { + public TaskHistoryService taskHistoryService(EventuateAggregateStore eventStore) { return new TaskHistoryService(eventStore); } diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskHistoryService.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskHistoryService.java index 4399a3fa..35b526f8 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskHistoryService.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskHistoryService.java @@ -1,22 +1,18 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.task; -import net.chrisrichardson.eventstore.EntityIdentifier; -import net.chrisrichardson.eventstore.EntityWithMetadata; -import net.chrisrichardson.eventstore.EventStore; -import rx.Observable; +import io.eventuate.EntityWithMetadata; +import io.eventuate.EventuateAggregateStore; +import java.util.concurrent.CompletableFuture; -/** - * Created by popikyardo on 03.11.15. - */ public class TaskHistoryService { - private EventStore eventStore; + private EventuateAggregateStore eventStore; - public TaskHistoryService(EventStore eventStore) { + public TaskHistoryService(EventuateAggregateStore eventStore) { this.eventStore = eventStore; } - public Observable> getHistoryEvents(String taskId) { - return eventStore.find(TaskAggregate.class, new EntityIdentifier(taskId)); + public CompletableFuture> getHistoryEvents(String taskId) { + return eventStore.find(TaskAggregate.class, taskId); } } diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskService.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskService.java index 7f89757c..42f2b4f5 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskService.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskService.java @@ -1,20 +1,16 @@ package net.chrisrichardson.eventstore.examples.kanban.commandside.task; -import net.chrisrichardson.eventstore.EntityIdentifier; -import net.chrisrichardson.eventstore.EntityWithIdAndVersion; +import io.eventuate.AggregateRepository; +import io.eventuate.EntityWithIdAndVersion; import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskDetails; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskInfo; -import net.chrisrichardson.eventstore.repository.AggregateRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import rx.Observable; import java.util.Date; +import java.util.concurrent.CompletableFuture; -/** - * Created by popikyardo on 15.10.15. - */ public class TaskService { private final AggregateRepository aggregateRepository; @@ -25,42 +21,42 @@ public TaskService(AggregateRepository aggregateRepo this.aggregateRepository = aggregateRepository; } - public Observable> save(TaskInfo task) { + public CompletableFuture> save(TaskInfo task) { log.info("TaskService saving : {}", task); return aggregateRepository.save(new CreateTaskCommand(task)); } - public Observable> update(String id, TaskDetails request, String updatedBy) { + public CompletableFuture> update(String id, TaskDetails request, String updatedBy) { log.info("TaskService updating {}: {}", id, request); - return aggregateRepository.update(new EntityIdentifier(id), new UpdateTaskCommand(request, + return aggregateRepository.update(id, new UpdateTaskCommand(request, new AuditEntry(updatedBy, new Date()))); } - public Observable> remove(String id, String updatedBy) { + public CompletableFuture> remove(String id, String updatedBy) { log.info("TaskService deleting : {}", id); - return aggregateRepository.update(new EntityIdentifier(id), new DeleteTaskCommand(new AuditEntry(updatedBy, new Date()))); + return aggregateRepository.update(id, new DeleteTaskCommand(new AuditEntry(updatedBy, new Date()))); } - public Observable> startTask(String id, String boardId, String updatedBy) { + public CompletableFuture> startTask(String id, String boardId, String updatedBy) { log.info("TaskService starting task : {}", id); - return aggregateRepository.update(new EntityIdentifier(id), new StartTaskCommand(boardId, + return aggregateRepository.update(id, new StartTaskCommand(boardId, new AuditEntry(updatedBy, new Date()))); } - public Observable> scheduleTask(String id, String boardId, String updatedBy) { + public CompletableFuture> scheduleTask(String id, String boardId, String updatedBy) { log.info("TaskService scheduling task : {}", id); - return aggregateRepository.update(new EntityIdentifier(id), new ScheduleTaskCommand(boardId, + return aggregateRepository.update(id, new ScheduleTaskCommand(boardId, new AuditEntry(updatedBy, new Date()))); } - public Observable> completeTask(String id, String boardId, String updatedBy) { + public CompletableFuture> completeTask(String id, String boardId, String updatedBy) { log.info("TaskService completing task : {}", id); - return aggregateRepository.update(new EntityIdentifier(id), new CompleteTaskCommand(boardId, + return aggregateRepository.update(id, new CompleteTaskCommand(boardId, new AuditEntry(updatedBy, new Date()))); } - public Observable> backlogTask(String id, String updatedBy) { + public CompletableFuture> backlogTask(String id, String updatedBy) { log.info("TaskService moving task to backlog : {}", id); - return aggregateRepository.update(new EntityIdentifier(id), new MoveToBacklogTaskCommand(new AuditEntry(updatedBy, new Date()))); + return aggregateRepository.update(id, new MoveToBacklogTaskCommand(new AuditEntry(updatedBy, new Date()))); } } diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/UpdateTaskCommand.java b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/UpdateTaskCommand.java index 65dd903b..cd339d38 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/UpdateTaskCommand.java +++ b/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/UpdateTaskCommand.java @@ -4,9 +4,6 @@ import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskDetails; import org.apache.commons.lang.builder.ToStringBuilder; -/** - * Created by popikyardo on 15.10.15. - */ public class UpdateTaskCommand implements TaskCommand { private TaskDetails taskDetails; private AuditEntry update; diff --git a/java-server/task-query-side-service/build.gradle b/java-server/task-query-side-service/build.gradle index 61c6d03c..2384a6c7 100755 --- a/java-server/task-query-side-service/build.gradle +++ b/java-server/task-query-side-service/build.gradle @@ -9,7 +9,7 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" - compile "net.chrisrichardson.eventstore.client:eventstore-http-stomp-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" testCompile "junit:junit:4.11" } diff --git a/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java b/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java index bd25e1a0..cc1e8460 100755 --- a/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java +++ b/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java @@ -1,6 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.taskquerysideservice; -import net.chrisrichardson.eventstore.client.config.EventStoreHttpClientConfiguration; +import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; @@ -14,7 +14,7 @@ * Created by Main on 19.01.2016. */ @Configuration -@Import({TaskQuerySideConfiguration.class, EventStoreHttpClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({TaskQuerySideConfiguration.class, EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class TaskQuerySideServiceConfiguration { diff --git a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryController.java b/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryController.java index bb650d35..4c53d72e 100755 --- a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryController.java +++ b/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryController.java @@ -14,9 +14,6 @@ import static org.springframework.http.HttpStatus.OK; import static org.springframework.web.bind.annotation.RequestMethod.GET; -/** - * Created by popikyardo on 19/09/2015. - */ @RestController public class TaskQueryController { diff --git a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQuerySideConfiguration.java b/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQuerySideConfiguration.java index fd37d2ef..dbe96ef2 100755 --- a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQuerySideConfiguration.java +++ b/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQuerySideConfiguration.java @@ -1,7 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.queryside.task; -import net.chrisrichardson.eventstore.javaapi.consumer.EnableJavaEventHandlers; -import net.chrisrichardson.eventstore.subscriptions.config.EventStoreSubscriptionsConfiguration; +import io.eventuate.javaclient.spring.EnableEventHandlers; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -9,7 +8,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; import org.springframework.data.mongodb.MongoDbFactory; import org.springframework.data.mongodb.core.convert.*; import org.springframework.data.mongodb.core.mapping.MongoMappingContext; @@ -17,15 +15,12 @@ import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -/** - * Created by popikyardo on 21.09.15. - */ + @Configuration -@Import({EventStoreSubscriptionsConfiguration.class}) @EnableAutoConfiguration @ComponentScan @EnableMongoRepositories -@EnableJavaEventHandlers +@EnableEventHandlers public class TaskQuerySideConfiguration { diff --git a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryWorkflow.java b/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryWorkflow.java index 8f23ab6e..122ca0c2 100755 --- a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryWorkflow.java +++ b/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryWorkflow.java @@ -1,22 +1,17 @@ package net.chrisrichardson.eventstore.examples.kanban.queryside.task; -import net.chrisrichardson.eventstore.Event; +import io.eventuate.DispatchedEvent; +import io.eventuate.Event; +import io.eventuate.EventHandlerMethod; +import io.eventuate.EventSubscriber; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskInfo; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskStatus; import net.chrisrichardson.eventstore.examples.kanban.common.task.event.*; -import net.chrisrichardson.eventstore.subscriptions.CompoundEventHandler; -import net.chrisrichardson.eventstore.subscriptions.DispatchedEvent; -import net.chrisrichardson.eventstore.subscriptions.EventHandlerMethod; -import net.chrisrichardson.eventstore.subscriptions.EventSubscriber; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import rx.Observable; -/** - * Created by popikyardo on 15.10.15. - */ @EventSubscriber(id = "taskEventHandlers") -public class TaskQueryWorkflow implements CompoundEventHandler { +public class TaskQueryWorkflow { private TaskUpdateService taskUpdateService; @@ -27,72 +22,64 @@ public TaskQueryWorkflow(TaskUpdateService taskUpdateService) { private static Logger log = LoggerFactory.getLogger(TaskQueryWorkflow.class); @EventHandlerMethod - public Observable create(DispatchedEvent de) { - String id = de.getEntityIdentifier().getId(); + public void create(DispatchedEvent de) { + String id = de.getEntityId(); - taskUpdateService.create(id, de.event().getTaskInfo()); - - return Observable.just(null); + taskUpdateService.create(id, de.getEvent().getTaskInfo()); } @EventHandlerMethod - public Observable update(DispatchedEvent de) { - log.info("TaskQueryWorkflow got event : {}", de.event()); + public void update(DispatchedEvent de) { + log.info("TaskQueryWorkflow got event : {}", de.getEvent()); TaskInfo taskInfo = new TaskInfo(); - taskInfo.setTaskDetails(de.event().getTaskDetails()); - taskInfo.setUpdate(de.event().getUpdate()); - - taskUpdateService.update(de.entityId().id(), taskInfo); + taskInfo.setTaskDetails(de.getEvent().getTaskDetails()); + taskInfo.setUpdate(de.getEvent().getUpdate()); - return Observable.just(null); + taskUpdateService.update(de.getEntityId(), taskInfo); } @EventHandlerMethod - public Observable complete(DispatchedEvent de) { - return processChangeStatusEvent(de, TaskStatus.completed); + public void complete(DispatchedEvent de) { + processChangeStatusEvent(de, TaskStatus.completed); } @EventHandlerMethod - public Observable delete(DispatchedEvent de) { - log.info("TaskQueryWorkflow got event : {}", de.event()); - taskUpdateService.delete(de.getEntityIdentifier().getId()); - - return Observable.just(null); + public void delete(DispatchedEvent de) { + log.info("TaskQueryWorkflow got event : {}", de.getEvent()); + taskUpdateService.delete(de.getEntityId()); } @EventHandlerMethod - public Observable schedule(DispatchedEvent de) { - return processChangeStatusEvent(de, TaskStatus.scheduled); + public void schedule(DispatchedEvent de) { + processChangeStatusEvent(de, TaskStatus.scheduled); } @EventHandlerMethod - public Observable backlog(DispatchedEvent de) { + public void backlog(DispatchedEvent de) { TaskInfo taskInfo = new TaskInfo(); - taskInfo.setUpdate(de.event().getUpdate()); + taskInfo.setUpdate(de.getEvent().getUpdate()); taskInfo.setStatus(TaskStatus.backlog); - return updateAndSendEvent(de, taskInfo); + updateAndSendEvent(de, taskInfo); } @EventHandlerMethod - public Observable start(DispatchedEvent de) { - return processChangeStatusEvent(de, TaskStatus.started); + public void start(DispatchedEvent de) { + processChangeStatusEvent(de, TaskStatus.started); } - private Observable processChangeStatusEvent(DispatchedEvent de, TaskStatus taskStatus) { + private void processChangeStatusEvent(DispatchedEvent de, TaskStatus taskStatus) { TaskInfo taskInfo = new TaskInfo(); - taskInfo.setBoardId(de.event().getBoardId()); - taskInfo.setUpdate(de.event().getUpdate()); + taskInfo.setBoardId(de.getEvent().getBoardId()); + taskInfo.setUpdate(de.getEvent().getUpdate()); taskInfo.setStatus(taskStatus); - return updateAndSendEvent((DispatchedEvent) de, taskInfo); + updateAndSendEvent((DispatchedEvent) de, taskInfo); } - private Observable updateAndSendEvent(DispatchedEvent de, TaskInfo taskInfo) { - log.info("TaskQueryWorkflow got event : {}", de.event()); - taskUpdateService.update(de.entityId().id(), taskInfo); - - return Observable.just(null); + private void updateAndSendEvent(DispatchedEvent de, TaskInfo taskInfo) { + log.info("TaskQueryWorkflow got event : {}", de.getEvent()); + taskUpdateService.update(de.getEntityId(), taskInfo); } } \ No newline at end of file diff --git a/java-server/test-utils/build.gradle b/java-server/test-utils/build.gradle index 24447793..5a13c51d 100755 --- a/java-server/test-utils/build.gradle +++ b/java-server/test-utils/build.gradle @@ -5,12 +5,13 @@ dependencies { compile project(":common-websocket") compile project(":common-web") - compile "net.chrisrichardson.eventstore.client:eventstore-java-client_2.10:$eventStoreClientVersion" + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "com.fasterxml.jackson.module:jackson-module-scala_2.10:2.4.3" compile "com.github.fge:json-schema-validator:2.2.6" compile "junit:junit:4.11" + compile "io.reactivex:rxjava:1.1.5" compile "org.apache.httpcomponents:fluent-hc:4.5.1" compile "org.apache.httpcomponents:httpclient:4.5" diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractAuthTest.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractAuthTest.java index 6f45a009..eece9368 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractAuthTest.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractAuthTest.java @@ -19,9 +19,6 @@ import java.io.IOException; -/** - * Created by popikyardo on 23.09.15. - */ @RunWith(SpringJUnit4ClassRunner.class) @IntegrationTest({"server.port=0"}) public abstract class AbstractAuthTest { diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractRestApiTest.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractRestApiTest.java index 9ae7ab36..4f915a2c 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractRestApiTest.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractRestApiTest.java @@ -23,9 +23,6 @@ import static net.chrisrichardson.eventstore.examples.kanban.testutil.util.TestUtil.awaitPredicatePasses; import static org.junit.Assert.assertTrue; -/** - * Created by popikyardo on 07.01.16. - */ @RunWith(SpringJUnit4ClassRunner.class) @IntegrationTest({"server.port=0"}) public abstract class AbstractRestApiTest extends BaseTest { diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractStompApiTest.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractStompApiTest.java index 184c2da7..91dc743f 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractStompApiTest.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/AbstractStompApiTest.java @@ -25,11 +25,6 @@ import static net.chrisrichardson.eventstore.examples.kanban.testutil.util.TestUtil.awaitPredicatePasses; - -/** - * Created by Main on 06.10.2015. - */ - @RunWith(SpringJUnit4ClassRunner.class) @IntegrationTest({"server.port=0"}) public abstract class AbstractStompApiTest extends BaseTest { diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BaseTest.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BaseTest.java index 4ade6770..f0bc3c2a 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BaseTest.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BaseTest.java @@ -45,9 +45,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -/** - * Created by popikyardo on 07.01.16. - */ public abstract class BaseTest { protected int port; diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BasicWebTestConfiguration.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BasicWebTestConfiguration.java index 11d265db..7269f450 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BasicWebTestConfiguration.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BasicWebTestConfiguration.java @@ -21,9 +21,6 @@ import java.util.Collections; -/** - * Created by popikyardo on 23.09.15. - */ @Configuration @EnableWebSecurity @Import({WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class}) diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/client/ConsumerStompMessageHandler.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/client/ConsumerStompMessageHandler.java index f235bade..f7a46f98 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/client/ConsumerStompMessageHandler.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/client/ConsumerStompMessageHandler.java @@ -9,9 +9,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; -/** - * Created by popikyardo on 23.12.15. - */ public class ConsumerStompMessageHandler implements StompMessageHandler { private final int expectedMessageCount; diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/model/TestHistoryEvent.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/model/TestHistoryEvent.java index 4ff2947c..29dd4343 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/model/TestHistoryEvent.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/model/TestHistoryEvent.java @@ -1,13 +1,8 @@ package net.chrisrichardson.eventstore.examples.kanban.testutil.model; - -import net.chrisrichardson.eventstore.Event; - import java.util.Map; -/** - * Created by popikyardo on 05.11.15. - */ + public class TestHistoryEvent { private String id; private String eventType; diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/model/TestHistoryResponse.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/model/TestHistoryResponse.java index b07556de..efa89c06 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/model/TestHistoryResponse.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/model/TestHistoryResponse.java @@ -2,9 +2,6 @@ import java.util.List; -/** - * Created by popikyardo on 21.12.15. - */ public class TestHistoryResponse { private List data; diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/StompListener.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/StompListener.java index f3ac6a03..072191d7 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/StompListener.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/StompListener.java @@ -25,9 +25,6 @@ import java.util.List; import java.util.concurrent.atomic.AtomicReference; -/** - * Created by popikyardo on 18.12.15. - */ public class StompListener { private String token; diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/TestUtil.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/TestUtil.java index 356159c2..9ac4ead1 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/TestUtil.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/TestUtil.java @@ -9,9 +9,6 @@ import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -/** - * Created by popikyardo on 30.09.15. - */ public class TestUtil { public static T awaitPredicatePasses(Func1 func, Func1 predicate) { diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/ValidationUtils.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/ValidationUtils.java index b16845fe..0e59c028 100644 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/ValidationUtils.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/util/ValidationUtils.java @@ -13,9 +13,6 @@ import java.io.IOException; import java.net.URL; -/** - * Created by popikyardo on 26.01.16. - */ public class ValidationUtils { public static final String JSON_V4_SCHEMA_IDENTIFIER = "http://json-schema.org/draft-04/schema#"; From f24c7c71bd8f7a0b7c8fc286f458f1ae58443081 Mon Sep 17 00:00:00 2001 From: Main Date: Wed, 13 Jul 2016 22:29:21 +0300 Subject: [PATCH 02/26] updated maven .pom files --- java-server/api-gateway-service/pom.xml | 8 ++-- .../src/main/resources/logback.xml | 2 +- .../board-command-side-service/pom.xml | 4 +- .../src/main/resources/logback.xml | 2 +- java-server/board-query-side-service/pom.xml | 4 +- java-server/common-board/pom.xml | 6 +++ java-server/common-swagger/pom.xml | 4 +- java-server/common-task/pom.xml | 6 +++ java-server/common/pom.xml | 4 +- java-server/e2e-test/pom.xml | 4 +- java-server/pom.xml | 37 +++++++++---------- .../rest-api-integration-tests/pom.xml | 4 +- java-server/standalone-service/pom.xml | 4 +- .../src/main/resources/logback.xml | 2 +- java-server/task-command-side-service/pom.xml | 4 +- java-server/task-query-side-service/pom.xml | 4 +- java-server/test-utils/pom.xml | 6 +++ 17 files changed, 61 insertions(+), 44 deletions(-) diff --git a/java-server/api-gateway-service/pom.xml b/java-server/api-gateway-service/pom.xml index 4e3d0343..86e06172 100755 --- a/java-server/api-gateway-service/pom.xml +++ b/java-server/api-gateway-service/pom.xml @@ -43,12 +43,12 @@ - net.chrisrichardson.eventstore.client - eventstore-http-stomp-client_2.10 + io.eventuate.client.java + eventuate-client-java-http-stomp-spring - net.chrisrichardson.eventstore.client - eventstore-java-client_2.10 + io.eventuate.client.java + eventuate-client-java-spring diff --git a/java-server/api-gateway-service/src/main/resources/logback.xml b/java-server/api-gateway-service/src/main/resources/logback.xml index 5d568b7c..2a03c9b2 100755 --- a/java-server/api-gateway-service/src/main/resources/logback.xml +++ b/java-server/api-gateway-service/src/main/resources/logback.xml @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/java-server/board-command-side-service/pom.xml b/java-server/board-command-side-service/pom.xml index 034e0981..2254c491 100755 --- a/java-server/board-command-side-service/pom.xml +++ b/java-server/board-command-side-service/pom.xml @@ -28,8 +28,8 @@ - net.chrisrichardson.eventstore.client - eventstore-http-stomp-client_2.10 + io.eventuate.client.java + eventuate-client-java-http-stomp-spring diff --git a/java-server/board-command-side-service/src/main/resources/logback.xml b/java-server/board-command-side-service/src/main/resources/logback.xml index 5d568b7c..2a03c9b2 100755 --- a/java-server/board-command-side-service/src/main/resources/logback.xml +++ b/java-server/board-command-side-service/src/main/resources/logback.xml @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/java-server/board-query-side-service/pom.xml b/java-server/board-query-side-service/pom.xml index e1c3c66c..ad7ccfed 100755 --- a/java-server/board-query-side-service/pom.xml +++ b/java-server/board-query-side-service/pom.xml @@ -28,8 +28,8 @@ - net.chrisrichardson.eventstore.client - eventstore-http-stomp-client_2.10 + io.eventuate.client.java + eventuate-client-java-http-stomp-spring diff --git a/java-server/common-board/pom.xml b/java-server/common-board/pom.xml index 00eaedd4..f3e40f9b 100755 --- a/java-server/common-board/pom.xml +++ b/java-server/common-board/pom.xml @@ -17,6 +17,12 @@ ${project.parent.version} + + com.fasterxml.jackson.core + jackson-annotations + 2.6.0 + + org.springframework.boot spring-boot-starter-data-mongodb diff --git a/java-server/common-swagger/pom.xml b/java-server/common-swagger/pom.xml index 87710948..b232ad8b 100755 --- a/java-server/common-swagger/pom.xml +++ b/java-server/common-swagger/pom.xml @@ -12,8 +12,8 @@ - net.chrisrichardson.eventstore.client - eventstore-java-client_2.10 + io.eventuate.client.java + eventuate-client-java-spring diff --git a/java-server/common-task/pom.xml b/java-server/common-task/pom.xml index e35567f7..3d1f21ab 100755 --- a/java-server/common-task/pom.xml +++ b/java-server/common-task/pom.xml @@ -17,6 +17,12 @@ ${project.parent.version} + + com.fasterxml.jackson.core + jackson-annotations + 2.6.0 + + org.springframework.boot spring-boot-starter-data-mongodb diff --git a/java-server/common/pom.xml b/java-server/common/pom.xml index 95efa340..255e784b 100755 --- a/java-server/common/pom.xml +++ b/java-server/common/pom.xml @@ -12,8 +12,8 @@ - net.chrisrichardson.eventstore.client - eventstore-java-client_2.10 + io.eventuate.client.java + eventuate-client-java-spring diff --git a/java-server/e2e-test/pom.xml b/java-server/e2e-test/pom.xml index ca5eae5f..b40b64c1 100755 --- a/java-server/e2e-test/pom.xml +++ b/java-server/e2e-test/pom.xml @@ -26,8 +26,8 @@ junit - net.chrisrichardson.eventstore.client - eventstore-jdbc_2.10 + io.eventuate.client.java + eventuate-client-java-jdbc diff --git a/java-server/pom.xml b/java-server/pom.xml index 5702cf03..4851be93 100755 --- a/java-server/pom.xml +++ b/java-server/pom.xml @@ -13,8 +13,8 @@ UTF-8 1.8 - 0.12 - 1.2.8.RELEASE + 0.2.0.RELEASE + 1.3.5.RELEASE 4.1.9.RELEASE @@ -45,20 +45,19 @@ - net.chrisrichardson.eventstore.client - eventstore-java-client_2.10 - ${eventStoreClientVersion} + io.eventuate.client.java + eventuate-client-java-spring + ${eventuateClientVersion} - net.chrisrichardson.eventstore.client - eventstore-jdbc_2.10 - ${eventStoreClientVersion} - test + io.eventuate.client.java + eventuate-client-java-jdbc + ${eventuateClientVersion} - net.chrisrichardson.eventstore.client - eventstore-http-stomp-client_2.10 - ${eventStoreClientVersion} + io.eventuate.client.java + eventuate-client-java-http-stomp-spring + ${eventuateClientVersion} @@ -176,13 +175,6 @@ - - central - https://repo1.maven.org/maven2 - - true - - eventuate-release http://mavenrepo.eventuate.io/release @@ -190,5 +182,12 @@ false + + central + https://repo1.maven.org/maven2 + + true + + \ No newline at end of file diff --git a/java-server/rest-api-integration-tests/pom.xml b/java-server/rest-api-integration-tests/pom.xml index 1015323b..b1f33985 100755 --- a/java-server/rest-api-integration-tests/pom.xml +++ b/java-server/rest-api-integration-tests/pom.xml @@ -75,8 +75,8 @@ junit - net.chrisrichardson.eventstore.client - eventstore-jdbc_2.10 + io.eventuate.client.java + eventuate-client-java-jdbc diff --git a/java-server/standalone-service/pom.xml b/java-server/standalone-service/pom.xml index cfb33616..f7caea67 100755 --- a/java-server/standalone-service/pom.xml +++ b/java-server/standalone-service/pom.xml @@ -48,8 +48,8 @@ - net.chrisrichardson.eventstore.client - eventstore-http-stomp-client_2.10 + io.eventuate.client.java + eventuate-client-java-http-stomp-spring diff --git a/java-server/standalone-service/src/main/resources/logback.xml b/java-server/standalone-service/src/main/resources/logback.xml index 5d568b7c..2a03c9b2 100755 --- a/java-server/standalone-service/src/main/resources/logback.xml +++ b/java-server/standalone-service/src/main/resources/logback.xml @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/java-server/task-command-side-service/pom.xml b/java-server/task-command-side-service/pom.xml index 13962f6d..44e73ffe 100755 --- a/java-server/task-command-side-service/pom.xml +++ b/java-server/task-command-side-service/pom.xml @@ -28,8 +28,8 @@ - net.chrisrichardson.eventstore.client - eventstore-http-stomp-client_2.10 + io.eventuate.client.java + eventuate-client-java-http-stomp-spring diff --git a/java-server/task-query-side-service/pom.xml b/java-server/task-query-side-service/pom.xml index 54eb141f..ee3c659d 100755 --- a/java-server/task-query-side-service/pom.xml +++ b/java-server/task-query-side-service/pom.xml @@ -33,8 +33,8 @@ - net.chrisrichardson.eventstore.client - eventstore-http-stomp-client_2.10 + io.eventuate.client.java + eventuate-client-java-http-stomp-spring diff --git a/java-server/test-utils/pom.xml b/java-server/test-utils/pom.xml index 6b6a97ef..464c498b 100755 --- a/java-server/test-utils/pom.xml +++ b/java-server/test-utils/pom.xml @@ -33,6 +33,12 @@ 2.2.6 + + io.reactivex + rxjava + 1.1.5 + + org.springframework.boot spring-boot-starter-test From 03bca6b0ae200c349bc09e89a044dc32b19985ba Mon Sep 17 00:00:00 2001 From: Main Date: Thu, 14 Jul 2016 21:41:03 +0300 Subject: [PATCH 03/26] fixed maven build files for the instegration tests --- java-server/pom.xml | 33 +++---------------- .../rest-api-integration-tests/pom.xml | 28 ---------------- 2 files changed, 5 insertions(+), 56 deletions(-) diff --git a/java-server/pom.xml b/java-server/pom.xml index 4851be93..78f7b80d 100755 --- a/java-server/pom.xml +++ b/java-server/pom.xml @@ -15,7 +15,7 @@ 1.8 0.2.0.RELEASE 1.3.5.RELEASE - 4.1.9.RELEASE + 4.2.6.RELEASE @@ -66,38 +66,15 @@ ${eventStoreClientVersion} - - - org.springframework.boot - spring-boot-starter - ${springBootVersion} - - - org.springframework.boot - spring-boot-starter-jdbc - ${springBootVersion} - - - org.springframework.boot - spring-boot-starter-data-mongodb - ${springBootVersion} - - - org.springframework.boot - spring-boot-starter-web - ${springBootVersion} - org.springframework.boot - spring-boot-starter-websocket - ${springBootVersion} - - - org.springframework.boot - spring-boot-starter-actuator + spring-boot-dependencies ${springBootVersion} + pom + import + org.springframework spring-web diff --git a/java-server/rest-api-integration-tests/pom.xml b/java-server/rest-api-integration-tests/pom.xml index b1f33985..e5e280ee 100755 --- a/java-server/rest-api-integration-tests/pom.xml +++ b/java-server/rest-api-integration-tests/pom.xml @@ -37,39 +37,11 @@ ${project.parent.version} - - org.apache.httpcomponents - fluent-hc - 4.5.1 - - - - org.springframework - spring-web - - org.springframework.boot spring-boot-starter-test - - - com.fasterxml.jackson.module - jackson-module-scala_2.10 - 2.4.3 - - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - 1.50.1 - - - - org.apache.httpcomponents - httpclient - junit junit From 68f593f0643c89debc29c0ccc1717bc9eaf05611 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 6 Oct 2016 21:19:08 +0300 Subject: [PATCH 04/26] added support for Eventuate Local --- java-server/api-gateway-service/build.gradle | 3 - .../board-command-side-service/build.gradle | 5 +- .../BoardCommandSideServiceConfiguration.java | 8 +- .../board-query-side-service/build.gradle | 7 +- .../BoardQuerySideServiceConfiguration.java | 6 +- .../groovy/EventuateDependencyPlugin.groovy | 16 ++ .../VerifyEventStoreEnvironmentPlugin.groovy | 17 ++ .../VerifyMongoDBConfigurationPlugin.groovy | 15 ++ .../_build-and-test-all.sh | 69 +++++++++ .../build-and-test-all-eventuate-local.sh | 6 + .../build-and-test-all.sh | 53 +------ .../docker-compose-common.yml | 46 ++++++ .../docker-compose-eventuate-local.yml | 146 ++++++++++++++++++ .../docker-microservices/docker-compose.yml | 73 ++++----- java-server/gradle.properties | 5 +- java-server/standalone-service/build.gradle | 7 +- .../StandaloneServiceConfiguration.java | 12 +- .../task-command-side-service/build.gradle | 5 +- .../TaskCommandSideServiceConfiguration.java | 6 +- .../task-query-side-service/build.gradle | 6 +- .../TaskQuerySideServiceConfiguration.java | 6 +- 21 files changed, 381 insertions(+), 136 deletions(-) create mode 100644 java-server/buildSrc/src/main/groovy/EventuateDependencyPlugin.groovy create mode 100644 java-server/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy create mode 100644 java-server/buildSrc/src/main/groovy/VerifyMongoDBConfigurationPlugin.groovy create mode 100755 java-server/docker-microservices/_build-and-test-all.sh create mode 100755 java-server/docker-microservices/build-and-test-all-eventuate-local.sh create mode 100755 java-server/docker-microservices/docker-compose-common.yml create mode 100644 java-server/docker-microservices/docker-compose-eventuate-local.yml diff --git a/java-server/api-gateway-service/build.gradle b/java-server/api-gateway-service/build.gradle index 039d9672..29f15a2a 100755 --- a/java-server/api-gateway-service/build.gradle +++ b/java-server/api-gateway-service/build.gradle @@ -11,9 +11,6 @@ dependencies { compile "org.apache.httpcomponents:httpclient:4.5" compile "org.apache.httpcomponents:fluent-hc:4.5.1" - compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" - compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" - compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" diff --git a/java-server/board-command-side-service/build.gradle b/java-server/board-command-side-service/build.gradle index 075be121..f980f0db 100755 --- a/java-server/board-command-side-service/build.gradle +++ b/java-server/board-command-side-service/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'java' +apply plugin: VerifyEventStoreEnvironmentPlugin +apply plugin: EventuateDependencyPlugin + apply plugin: 'spring-boot' dependencies { @@ -9,6 +11,5 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" testCompile "junit:junit:4.11" } \ No newline at end of file diff --git a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java b/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java index 0d48d3f1..55fc8836 100755 --- a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java +++ b/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java @@ -1,17 +1,17 @@ package net.chrisrichardson.eventstore.examples.kanban.boardcommandsideservice; -import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; +import io.eventuate.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardCommandSideConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({BoardCommandSideConfiguration.class, EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({BoardCommandSideConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class BoardCommandSideServiceConfiguration { diff --git a/java-server/board-query-side-service/build.gradle b/java-server/board-query-side-service/build.gradle index b32d7aeb..ff8b0683 100755 --- a/java-server/board-query-side-service/build.gradle +++ b/java-server/board-query-side-service/build.gradle @@ -1,4 +1,7 @@ -apply plugin: 'java' +apply plugin: VerifyMongoDBConfigurationPlugin +apply plugin: VerifyEventStoreEnvironmentPlugin +apply plugin: EventuateDependencyPlugin + apply plugin: 'spring-boot' dependencies { @@ -9,7 +12,5 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" - compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" testCompile "junit:junit:4.11" } diff --git a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java b/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java index 4186cf10..9fa762ba 100755 --- a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java +++ b/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java @@ -1,9 +1,9 @@ package net.chrisrichardson.eventstore.examples.kanban.boardquerysideservice; -import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; +import io.eventuate.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.queryside.board.BoardQuerySideConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Import; @Configuration -@Import({BoardQuerySideConfiguration.class, EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({BoardQuerySideConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class BoardQuerySideServiceConfiguration { diff --git a/java-server/buildSrc/src/main/groovy/EventuateDependencyPlugin.groovy b/java-server/buildSrc/src/main/groovy/EventuateDependencyPlugin.groovy new file mode 100644 index 00000000..d227f0fe --- /dev/null +++ b/java-server/buildSrc/src/main/groovy/EventuateDependencyPlugin.groovy @@ -0,0 +1,16 @@ +import org.gradle.api.Plugin +import org.gradle.api.Project + +class EventuateDependencyPlugin implements Plugin { + + @Override + void apply(Project project) { + project.dependencies { + if (project.hasProperty("eventuateDriver") && project.property("eventuateDriver") == "local") { + compile "io.eventuate.local.java:eventuate-local-java-jdbc:${project.eventuateLocalVersion}" + compile "io.eventuate.local.java:eventuate-local-java-embedded-cdc-autoconfigure:${project.eventuateLocalVersion}" + } else + compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:${project.eventuateClientVersion}" + } + } +} diff --git a/java-server/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy b/java-server/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy new file mode 100644 index 00000000..0b029931 --- /dev/null +++ b/java-server/buildSrc/src/main/groovy/VerifyEventStoreEnvironmentPlugin.groovy @@ -0,0 +1,17 @@ +import org.gradle.api.* + + +class VerifyEventStoreEnvironmentPlugin implements Plugin { + void apply(Project project) { + project.test { + beforeSuite { x -> + if (x.parent == null) { + if (!project.hasProperty("eventuateDriver") || project.property("eventuateDriver") != "local") { + if (System.getenv("EVENTUATE_API_KEY_ID") == null && System.getenv("EVENTUATE_API_KEY_SECRET") == null) + 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") + } + } + } + } + } +} diff --git a/java-server/buildSrc/src/main/groovy/VerifyMongoDBConfigurationPlugin.groovy b/java-server/buildSrc/src/main/groovy/VerifyMongoDBConfigurationPlugin.groovy new file mode 100644 index 00000000..1486a0d0 --- /dev/null +++ b/java-server/buildSrc/src/main/groovy/VerifyMongoDBConfigurationPlugin.groovy @@ -0,0 +1,15 @@ +import org.gradle.api.* + + +class VerifyMongoDBConfigurationPlugin implements Plugin { + void apply(Project project) { + project.test { + beforeSuite { x -> + if (x.parent == null) { + if (System.getenv("SPRING_DATA_MONGODB_URI") == null) + throw new RuntimeException("Please make sure that the environment variable SPRING_DATA_MONGODB_URI is set, e.g. export SPRING_DATA_MONGODB_URI=mongodb://192.168.59.103/mydb") + } + } + } + } +} \ No newline at end of file diff --git a/java-server/docker-microservices/_build-and-test-all.sh b/java-server/docker-microservices/_build-and-test-all.sh new file mode 100755 index 00000000..0905a49d --- /dev/null +++ b/java-server/docker-microservices/_build-and-test-all.sh @@ -0,0 +1,69 @@ +#! /bin/bash + +set -e + +DOCKER_COMPOSE="docker-compose -p kanban-board" + +if [ "$1" = "-f" ] ; then + shift; + DOCKER_COMPOSE="$DOCKER_COMPOSE -f ${1?}" + shift +fi + +if [ "$1" = "--use-existing" ] ; then + shift; +else + ${DOCKER_COMPOSE?} stop + ${DOCKER_COMPOSE?} rm -v --force +fi + +NO_RM=false + +if [ "$1" = "--no-rm" ] ; then + NO_RM=true + shift +fi + +${DOCKER_COMPOSE?} up -d mongodb $EXTRA_INFRASTRUCTURE_SERVICES + +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 +export DOCKER_PORT=8080 + +cd .. + +./gradlew $* build -x :e2e-test:test + +cd ./docker-microservices + +if [ -z "$EVENTUATE_LOCAL" ] && [ -z "$EVENTUATE_API_KEY_ID" -o -z "$EVENTUATE_API_KEY_SECRET" ] ; then + echo You must set EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET + exit -1 +fi + + +${DOCKER_COMPOSE?} up -d + +./wait-for-services.sh $DOCKER_HOST_IP 8080 8081 8082 8083 8084 + +set -e + +cd .. + +./gradlew -P ignoreE2EFailures=false $* :e2e-test:cleanTest :e2e-test:test + +cd ./docker-microservices + +if [ $NO_RM = false ] ; then + ${DOCKER_COMPOSE?} stop + ${DOCKER_COMPOSE?} rm -v --force +fi diff --git a/java-server/docker-microservices/build-and-test-all-eventuate-local.sh b/java-server/docker-microservices/build-and-test-all-eventuate-local.sh new file mode 100755 index 00000000..eb629a81 --- /dev/null +++ b/java-server/docker-microservices/build-and-test-all-eventuate-local.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +export EXTRA_INFRASTRUCTURE_SERVICES=cdcservice +export EVENTUATE_LOCAL=yes + +./_build-and-test-all.sh -f docker-compose-eventuate-local.yml $* -P eventuateDriver=local diff --git a/java-server/docker-microservices/build-and-test-all.sh b/java-server/docker-microservices/build-and-test-all.sh index eeff07ec..569dd718 100755 --- a/java-server/docker-microservices/build-and-test-all.sh +++ b/java-server/docker-microservices/build-and-test-all.sh @@ -1,54 +1,3 @@ #! /bin/bash -set -e - -DOCKER_COMPOSE="docker-compose -p kanban-board" - -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 -export DOCKER_PORT=8080 - -cd .. - -./gradlew $* build -xe2e-test:test - -cd ./docker-microservices - -if [ -z "$EVENTUATE_API_KEY_ID" -o -z "$EVENTUATE_API_KEY_SECRET" ] ; then - echo You must set EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET - exit -1 -fi - - -${DOCKER_COMPOSE?} up -d - -./wait-for-services.sh $DOCKER_HOST_IP 8080 8081 8082 8083 8084 - -set -e - -cd .. - -./gradlew -P ignoreE2EFailures=false $* :e2e-test:cleanTest :e2e-test:test - -cd ./docker-microservices - -${DOCKER_COMPOSE?} stop -${DOCKER_COMPOSE?} rm -v --force +./_build-and-test-all.sh $* diff --git a/java-server/docker-microservices/docker-compose-common.yml b/java-server/docker-microservices/docker-compose-common.yml new file mode 100755 index 00000000..ce25dec4 --- /dev/null +++ b/java-server/docker-microservices/docker-compose-common.yml @@ -0,0 +1,46 @@ +apigateway: + image: java:openjdk-8u91-jdk + command: java -jar /app/api-gateway-service.jar + ports: + - "8080:8080" + environment: + BOARD_COMMANDSIDE_SERVICE_URL: http://boardcommandside:8080 + BOARD_QUERYSIDE_SERVICE_URL: http://boardqueryside:8080 + TASK_COMMANDSIDE_SERVICE_URL: http://taskcommandside:8080 + TASK_QUERYSIDE_SERVICE_URL: http://taskqueryside:8080 + + +boardcommandside: + image: java:openjdk-8u91-jdk + command: java -jar /app/board-command-side-service.jar + ports: + - "8081:8080" + +taskcommandside: + image: java:openjdk-8u91-jdk + command: java -jar /app/task-command-side-service.jar + ports: + - "8082:8080" + +boardqueryside: + image: java:openjdk-8u91-jdk + command: java -jar /app/board-query-side-service.jar + ports: + - "8083:8080" + environment: + SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban + +taskqueryside: + image: java:openjdk-8u91-jdk + command: java -jar /app/task-query-side-service.jar + ports: + - "8084:8080" + environment: + SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban + +mongodb: + image: mongo:3.0.4 + hostname: mongodb + command: mongod --smallfiles + ports: + - "27017:27017" \ No newline at end of file diff --git a/java-server/docker-microservices/docker-compose-eventuate-local.yml b/java-server/docker-microservices/docker-compose-eventuate-local.yml new file mode 100644 index 00000000..820a3df0 --- /dev/null +++ b/java-server/docker-microservices/docker-compose-eventuate-local.yml @@ -0,0 +1,146 @@ +zookeeper: + image: eventuateio/eventuateio-local-zookeeper:0.6.0 + ports: + - 2181:2181 + - 2888:2888 + - 3888:3888 + + +kafka: + image: eventuateio/eventuateio-local-kafka:0.6.0 + ports: + - 9092:9092 + links: + - zookeeper + environment: + - ADVERTISED_HOST_NAME=${DOCKER_HOST_IP} + - KAFKA_HEAP_OPTS=-Xmx320m -Xms320m + - ZOOKEEPER_SERVERS=zookeeper:2181 + +mysql: + image: eventuateio/eventuateio-local-mysql:0.6.0 + ports: + - 3306:3306 + environment: + - MYSQL_ROOT_PASSWORD=rootpassword + - MYSQL_USER=mysqluser + - MYSQL_PASSWORD=mysqlpw + + +cdcservice: + image: eventuateio/eventuateio-local-cdc-service:0.6.0 + ports: + - "8099:8080" + links: + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 + EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 + EVENTUATELOCAL_CDC_DB_USER_NAME: root + EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword + +mongodb: + extends: + file: docker-compose-common.yml + service: mongodb + +apigateway: + extends: + file: docker-compose-common.yml + service: apigateway + volumes: + - ../api-gateway-service/build/libs:/app + links: + - boardcommandside + - taskcommandside + - boardqueryside + - taskqueryside + + +boardcommandside: + extends: + file: docker-compose-common.yml + service: boardcommandside + volumes: + - ../board-command-side-service/build/libs:/app + links: + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 + EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 + EVENTUATELOCAL_CDC_DB_USER_NAME: root + EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword + +taskcommandside: + extends: + file: docker-compose-common.yml + service: taskcommandside + volumes: + - ../task-command-side-service/build/libs:/app + links: + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 + EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 + EVENTUATELOCAL_CDC_DB_USER_NAME: root + EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword + +boardqueryside: + extends: + file: docker-compose-common.yml + service: boardqueryside + volumes: + - ../board-query-side-service/build/libs:/app + links: + - mongodb + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 + EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 + EVENTUATELOCAL_CDC_DB_USER_NAME: root + EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword + +taskqueryside: + extends: + file: docker-compose-common.yml + service: taskqueryside + volumes: + - ../task-query-side-service/build/libs:/app + links: + - mongodb + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 + EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 + EVENTUATELOCAL_CDC_DB_USER_NAME: root + EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword \ No newline at end of file diff --git a/java-server/docker-microservices/docker-compose.yml b/java-server/docker-microservices/docker-compose.yml index e212d913..1a59c42f 100755 --- a/java-server/docker-microservices/docker-compose.yml +++ b/java-server/docker-microservices/docker-compose.yml @@ -1,82 +1,61 @@ apigateway: - image: java:openjdk-8u91-jdk - working_dir: /app + extends: + file: docker-compose-common.yml + service: apigateway volumes: - ../api-gateway-service/build/libs:/app - command: java -jar /app/api-gateway-service.jar - ports: - - "8080:8080" links: - boardcommandside - taskcommandside - boardqueryside - taskqueryside - environment: - EVENTUATE_API_KEY_ID: - EVENTUATE_API_KEY_SECRET: - BOARD_COMMANDSIDE_SERVICE_URL: http://boardcommandside:8080 - BOARD_QUERYSIDE_SERVICE_URL: http://boardqueryside:8080 - TASK_COMMANDSIDE_SERVICE_URL: http://taskcommandside:8080 - TASK_QUERYSIDE_SERVICE_URL: http://taskqueryside:8080 boardcommandside: - image: java:openjdk-8u91-jdk - working_dir: /app + extends: + file: docker-compose-common.yml + service: boardcommandside volumes: - ../board-command-side-service/build/libs:/app - command: java -jar /app/board-command-side-service.jar - ports: - - "8081:8080" environment: - EVENTUATE_API_KEY_ID: - EVENTUATE_API_KEY_SECRET: + EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} + EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} taskcommandside: - image: java:openjdk-8u91-jdk - working_dir: /app + extends: + file: docker-compose-common.yml + service: taskcommandside volumes: - ../task-command-side-service/build/libs:/app - command: java -jar /app/task-command-side-service.jar - ports: - - "8082:8080" environment: - EVENTUATE_API_KEY_ID: - EVENTUATE_API_KEY_SECRET: + EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} + EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} boardqueryside: - image: java:openjdk-8u91-jdk - working_dir: /app + extends: + file: docker-compose-common.yml + service: boardqueryside volumes: - ../board-query-side-service/build/libs:/app - command: java -jar /app/board-query-side-service.jar - ports: - - "8083:8080" links: - mongodb environment: - EVENTUATE_API_KEY_ID: - EVENTUATE_API_KEY_SECRET: - SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban + EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} + EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} taskqueryside: - image: java:openjdk-8u91-jdk - working_dir: /app + extends: + file: docker-compose-common.yml + service: taskqueryside volumes: - ../task-query-side-service/build/libs:/app - command: java -jar /app/task-query-side-service.jar - ports: - - "8084:8080" links: - mongodb environment: - EVENTUATE_API_KEY_ID: - EVENTUATE_API_KEY_SECRET: - SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban + EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} + EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} mongodb: - image: mongo:3.0.4 - hostname: mongodb - command: mongod --smallfiles - ports: - - "27017:27017" \ No newline at end of file + extends: + file: docker-compose-common.yml + service: mongodb \ No newline at end of file diff --git a/java-server/gradle.properties b/java-server/gradle.properties index c0104c20..930c43ae 100755 --- a/java-server/gradle.properties +++ b/java-server/gradle.properties @@ -2,5 +2,8 @@ org.gradle.jvmargs=-XX:MaxPermSize=512m eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release -eventuateClientVersion=0.10.0.RELEASE + springBootVersion=1.3.5.RELEASE + +eventuateClientVersion=0.10.0.RELEASE +eventuateLocalVersion=0.4.0.RELEASE \ No newline at end of file diff --git a/java-server/standalone-service/build.gradle b/java-server/standalone-service/build.gradle index 5a10c42b..36dd1a85 100755 --- a/java-server/standalone-service/build.gradle +++ b/java-server/standalone-service/build.gradle @@ -1,5 +1,7 @@ +apply plugin: VerifyMongoDBConfigurationPlugin +apply plugin: VerifyEventStoreEnvironmentPlugin +apply plugin: EventuateDependencyPlugin -apply plugin: 'java' apply plugin: 'spring-boot' dependencies { @@ -11,9 +13,6 @@ dependencies { compile project(":common-websocket") compile project(":common-swagger") - compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" - compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" - compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" diff --git a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java b/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java index 5c88b837..710b5757 100755 --- a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java +++ b/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java @@ -1,6 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.standalone; -import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; +import io.eventuate.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; @@ -18,11 +18,11 @@ import org.springframework.messaging.simp.SimpMessagingTemplate; @Configuration -@Import({EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class, BoardQuerySideConfiguration.class, TaskQuerySideConfiguration.class, BoardCommandSideConfiguration.class, TaskCommandSideConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class, BoardQuerySideConfiguration.class, TaskQuerySideConfiguration.class, BoardCommandSideConfiguration.class, TaskCommandSideConfiguration.class, CommonSwaggerConfiguration.class}) @ComponentScan public class StandaloneServiceConfiguration { - @Bean - public WebsocketEventsTranslator websocketEventsTranslator(SimpMessagingTemplate template) { - return new WebsocketEventsTranslator(template); - } + @Bean + public WebsocketEventsTranslator websocketEventsTranslator(SimpMessagingTemplate template) { + return new WebsocketEventsTranslator(template); + } } \ No newline at end of file diff --git a/java-server/task-command-side-service/build.gradle b/java-server/task-command-side-service/build.gradle index e1a8b6c1..1db45a5a 100755 --- a/java-server/task-command-side-service/build.gradle +++ b/java-server/task-command-side-service/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'java' +apply plugin: VerifyEventStoreEnvironmentPlugin +apply plugin: EventuateDependencyPlugin + apply plugin: 'spring-boot' dependencies { @@ -9,6 +11,5 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" testCompile "junit:junit:4.11" } \ No newline at end of file diff --git a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java b/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java index fd2357f5..d1f5e97d 100755 --- a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java +++ b/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java @@ -1,10 +1,10 @@ package net.chrisrichardson.eventstore.examples.kanban.taskcommandsideservice; -import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; +import io.eventuate.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -12,7 +12,7 @@ @Configuration -@Import({TaskCommandSideConfiguration.class, EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({TaskCommandSideConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class TaskCommandSideServiceConfiguration { diff --git a/java-server/task-query-side-service/build.gradle b/java-server/task-query-side-service/build.gradle index 2384a6c7..98130ed9 100755 --- a/java-server/task-query-side-service/build.gradle +++ b/java-server/task-query-side-service/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'java' +apply plugin: VerifyEventStoreEnvironmentPlugin +apply plugin: EventuateDependencyPlugin + apply plugin: 'spring-boot' dependencies { @@ -9,7 +11,5 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" - compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion" testCompile "junit:junit:4.11" } diff --git a/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java b/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java index cc1e8460..a8e8c1e9 100755 --- a/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java +++ b/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java @@ -1,9 +1,9 @@ package net.chrisrichardson.eventstore.examples.kanban.taskquerysideservice; -import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; +import io.eventuate.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.queryside.task.TaskQuerySideConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; @@ -14,7 +14,7 @@ * Created by Main on 19.01.2016. */ @Configuration -@Import({TaskQuerySideConfiguration.class, EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({TaskQuerySideConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) @EnableAutoConfiguration @ComponentScan public class TaskQuerySideServiceConfiguration { From 50e9dfb859c570d881ecef6086045a530b0e936e Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 6 Oct 2016 21:21:25 +0300 Subject: [PATCH 05/26] added set-env script --- java-server/docker-microservices/set-env.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 java-server/docker-microservices/set-env.sh diff --git a/java-server/docker-microservices/set-env.sh b/java-server/docker-microservices/set-env.sh new file mode 100755 index 00000000..18b9de54 --- /dev/null +++ b/java-server/docker-microservices/set-env.sh @@ -0,0 +1,20 @@ +if [ -z "$DOCKER_HOST_IP" ] ; then + if [ -z "$DOCKER_HOST" ] ; then + export DOCKER_HOST_IP=`hostname` + else + echo using ${DOCKER_HOST?} + XX=${DOCKER_HOST%\:*} + export DOCKER_HOST_IP=${XX#tcp\:\/\/} + fi +fi + +echo DOCKER_HOST_IP is $DOCKER_HOST_IP + +export SPRING_DATASOURCE_URL=jdbc:mysql://${DOCKER_HOST_IP}/eventuate +export SPRING_DATASOURCE_USERNAME=mysqluser +export SPRING_DATASOURCE_PASSWORD=mysqlpw +export SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.jdbc.Driver +export EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS=$DOCKER_HOST_IP:9092 +export EVENTUATELOCAL_CDC_DB_USER_NAME=root +export EVENTUATELOCAL_CDC_DB_PASSWORD=rootpassword +export EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING=$DOCKER_HOST_IP:2181 \ No newline at end of file From bba171ccf03f9f072528fbd372566025a4771138 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 6 Oct 2016 21:26:48 +0300 Subject: [PATCH 06/26] fixed api-gateway configuration --- .../ApiGatewayServiceConfiguration.java | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java index a7ca9056..59257b94 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java @@ -1,7 +1,6 @@ package net.chrisrichardson.eventstore.examples.kanban.apigateway; import com.fasterxml.jackson.databind.ObjectMapper; -import io.eventuate.javaclient.spring.httpstomp.EventuateHttpStompClientConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebSocketConfig; @@ -26,29 +25,29 @@ @Configuration @ComponentScan -@Import({EventuateHttpStompClientConfiguration.class, WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class}) +@Import({WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class}) @EnableConfigurationProperties({ApiGatewayProperties.class}) public class ApiGatewayServiceConfiguration { - @Bean - public WebsocketEventsTranslator websocketEventsTranslator(SimpMessagingTemplate template) { - return new WebsocketEventsTranslator(template); - } + @Bean + public WebsocketEventsTranslator websocketEventsTranslator(SimpMessagingTemplate template) { + return new WebsocketEventsTranslator(template); + } - @Bean - public RestTemplate restTemplate(HttpMessageConverters converters) { + @Bean + public RestTemplate restTemplate(HttpMessageConverters converters) { - // we have to define Apache HTTP client to use the PATCH verb - MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); - converter.setSupportedMediaTypes(MediaType.parseMediaTypes("application/json")); - converter.setObjectMapper(new ObjectMapper()); + // we have to define Apache HTTP client to use the PATCH verb + MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); + converter.setSupportedMediaTypes(MediaType.parseMediaTypes("application/json")); + converter.setObjectMapper(new ObjectMapper()); - HttpClient httpClient = HttpClients.createDefault(); - RestTemplate restTemplate = new RestTemplate(Collections.>singletonList(converter)); - restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory(httpClient)); + HttpClient httpClient = HttpClients.createDefault(); + RestTemplate restTemplate = new RestTemplate(Collections.>singletonList(converter)); + restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory(httpClient)); - restTemplate.setErrorHandler(new RestTemplateErrorHandler()); + restTemplate.setErrorHandler(new RestTemplateErrorHandler()); - return restTemplate; - } + return restTemplate; + } } From 3539e95d74a1896ad7f60496ebfd7c96f3561108 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 6 Oct 2016 22:07:31 +0300 Subject: [PATCH 07/26] added Eevenruate config to api-gateway (it needs for web-sockets) --- java-server/api-gateway-service/build.gradle | 4 +++- .../kanban/apigateway/ApiGatewayServiceConfiguration.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/java-server/api-gateway-service/build.gradle b/java-server/api-gateway-service/build.gradle index 29f15a2a..b5961b25 100755 --- a/java-server/api-gateway-service/build.gradle +++ b/java-server/api-gateway-service/build.gradle @@ -1,4 +1,6 @@ -apply plugin: 'java' +apply plugin: VerifyEventStoreEnvironmentPlugin +apply plugin: EventuateDependencyPlugin + apply plugin: 'spring-boot' dependencies { diff --git a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java index 59257b94..d6ebfa74 100755 --- a/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java +++ b/java-server/api-gateway-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/apigateway/ApiGatewayServiceConfiguration.java @@ -1,6 +1,7 @@ package net.chrisrichardson.eventstore.examples.kanban.apigateway; import com.fasterxml.jackson.databind.ObjectMapper; +import io.eventuate.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebSocketConfig; @@ -25,7 +26,7 @@ @Configuration @ComponentScan -@Import({WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class}) +@Import({EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class}) @EnableConfigurationProperties({ApiGatewayProperties.class}) public class ApiGatewayServiceConfiguration { From 1ac5397f83a4a4acfa30c1f5c408295e268cd021 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Thu, 6 Oct 2016 22:19:30 +0300 Subject: [PATCH 08/26] fixed docker compose scripts for api-gateway --- .../docker-compose-eventuate-local.yml | 12 ++++++++++++ java-server/docker-microservices/docker-compose.yml | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/java-server/docker-microservices/docker-compose-eventuate-local.yml b/java-server/docker-microservices/docker-compose-eventuate-local.yml index 820a3df0..fcb63b6b 100644 --- a/java-server/docker-microservices/docker-compose-eventuate-local.yml +++ b/java-server/docker-microservices/docker-compose-eventuate-local.yml @@ -61,6 +61,18 @@ apigateway: - taskcommandside - boardqueryside - taskqueryside + - mysql + - kafka + - zookeeper + environment: + SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate + SPRING_DATASOURCE_USERNAME: mysqluser + SPRING_DATASOURCE_PASSWORD: mysqlpw + SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver + EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092 + EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181 + EVENTUATELOCAL_CDC_DB_USER_NAME: root + EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword boardcommandside: diff --git a/java-server/docker-microservices/docker-compose.yml b/java-server/docker-microservices/docker-compose.yml index 1a59c42f..bf06a02c 100755 --- a/java-server/docker-microservices/docker-compose.yml +++ b/java-server/docker-microservices/docker-compose.yml @@ -9,7 +9,9 @@ apigateway: - taskcommandside - boardqueryside - taskqueryside - + environment: + EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} + EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} boardcommandside: extends: From 659309b168cd83aedde39c4d039e1a3fad7a232b Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Fri, 7 Oct 2016 19:56:10 +0300 Subject: [PATCH 09/26] fixed logback files --- java-server/api-gateway-service/src/main/resources/logback.xml | 2 +- .../board-command-side-service/src/main/resources/logback.xml | 2 +- java-server/standalone-service/src/main/resources/logback.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java-server/api-gateway-service/src/main/resources/logback.xml b/java-server/api-gateway-service/src/main/resources/logback.xml index 2a03c9b2..8bdebf05 100755 --- a/java-server/api-gateway-service/src/main/resources/logback.xml +++ b/java-server/api-gateway-service/src/main/resources/logback.xml @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/java-server/board-command-side-service/src/main/resources/logback.xml b/java-server/board-command-side-service/src/main/resources/logback.xml index 2a03c9b2..8bdebf05 100755 --- a/java-server/board-command-side-service/src/main/resources/logback.xml +++ b/java-server/board-command-side-service/src/main/resources/logback.xml @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/java-server/standalone-service/src/main/resources/logback.xml b/java-server/standalone-service/src/main/resources/logback.xml index 2a03c9b2..8bdebf05 100755 --- a/java-server/standalone-service/src/main/resources/logback.xml +++ b/java-server/standalone-service/src/main/resources/logback.xml @@ -14,6 +14,6 @@ - + \ No newline at end of file From 1585a819e1ea7ea74ec7a10ee28c0279cb14ecd5 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Mon, 10 Oct 2016 10:55:11 +0300 Subject: [PATCH 10/26] changed log level for "io.eventuate.activity" loggers --- .../api-gateway-service/src/main/resources/logback.xml | 4 +++- .../board-command-side-service/src/main/resources/logback.xml | 4 +++- java-server/standalone-service/src/main/resources/logback.xml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/java-server/api-gateway-service/src/main/resources/logback.xml b/java-server/api-gateway-service/src/main/resources/logback.xml index 8bdebf05..84cbb835 100755 --- a/java-server/api-gateway-service/src/main/resources/logback.xml +++ b/java-server/api-gateway-service/src/main/resources/logback.xml @@ -14,6 +14,8 @@ - + + + \ No newline at end of file diff --git a/java-server/board-command-side-service/src/main/resources/logback.xml b/java-server/board-command-side-service/src/main/resources/logback.xml index 8bdebf05..84cbb835 100755 --- a/java-server/board-command-side-service/src/main/resources/logback.xml +++ b/java-server/board-command-side-service/src/main/resources/logback.xml @@ -14,6 +14,8 @@ - + + + \ No newline at end of file diff --git a/java-server/standalone-service/src/main/resources/logback.xml b/java-server/standalone-service/src/main/resources/logback.xml index 8bdebf05..84cbb835 100755 --- a/java-server/standalone-service/src/main/resources/logback.xml +++ b/java-server/standalone-service/src/main/resources/logback.xml @@ -14,6 +14,8 @@ - + + + \ No newline at end of file From 9b93659f2701bebde81a4e1ac2c17f44c982464c Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Tue, 11 Oct 2016 20:20:00 +0300 Subject: [PATCH 11/26] -added Dockerfiles --- java-server/api-gateway-service/Dockerfile | 5 +++++ java-server/board-command-side-service/Dockerfile | 5 +++++ java-server/board-query-side-service/Dockerfile | 5 +++++ java-server/task-command-side-service/Dockerfile | 5 +++++ java-server/task-query-side-service/Dockerfile | 5 +++++ 5 files changed, 25 insertions(+) create mode 100644 java-server/api-gateway-service/Dockerfile create mode 100644 java-server/board-command-side-service/Dockerfile create mode 100644 java-server/board-query-side-service/Dockerfile create mode 100644 java-server/task-command-side-service/Dockerfile create mode 100644 java-server/task-query-side-service/Dockerfile diff --git a/java-server/api-gateway-service/Dockerfile b/java-server/api-gateway-service/Dockerfile new file mode 100644 index 00000000..e0d650a6 --- /dev/null +++ b/java-server/api-gateway-service/Dockerfile @@ -0,0 +1,5 @@ +FROM java:openjdk-8u91-jdk +RUN mkdir /app +WORKDIR /app +COPY ./build/libs /app +CMD java ${JAVA_OPTS} -jar /app/api-gateway-service.jar diff --git a/java-server/board-command-side-service/Dockerfile b/java-server/board-command-side-service/Dockerfile new file mode 100644 index 00000000..189db789 --- /dev/null +++ b/java-server/board-command-side-service/Dockerfile @@ -0,0 +1,5 @@ +FROM java:openjdk-8u91-jdk +RUN mkdir /app +WORKDIR /app +COPY ./build/libs /app +CMD java ${JAVA_OPTS} -jar /app/board-command-side-service.jar diff --git a/java-server/board-query-side-service/Dockerfile b/java-server/board-query-side-service/Dockerfile new file mode 100644 index 00000000..6c189588 --- /dev/null +++ b/java-server/board-query-side-service/Dockerfile @@ -0,0 +1,5 @@ +FROM java:openjdk-8u91-jdk +RUN mkdir /app +WORKDIR /app +COPY ./build/libs /app +CMD java ${JAVA_OPTS} -jar /app/board-query-side-service.jar diff --git a/java-server/task-command-side-service/Dockerfile b/java-server/task-command-side-service/Dockerfile new file mode 100644 index 00000000..ad54db51 --- /dev/null +++ b/java-server/task-command-side-service/Dockerfile @@ -0,0 +1,5 @@ +FROM java:openjdk-8u91-jdk +RUN mkdir /app +WORKDIR /app +COPY ./build/libs /app +CMD java ${JAVA_OPTS} -jar /app/task-command-side-service.jar diff --git a/java-server/task-query-side-service/Dockerfile b/java-server/task-query-side-service/Dockerfile new file mode 100644 index 00000000..96b47588 --- /dev/null +++ b/java-server/task-query-side-service/Dockerfile @@ -0,0 +1,5 @@ +FROM java:openjdk-8u91-jdk +RUN mkdir /app +WORKDIR /app +COPY ./build/libs /app +CMD java ${JAVA_OPTS} -jar /app/task-query-side-service.jar From d8f7f53e362e9a5b35b08fae2854de433dfdcdff Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Tue, 11 Oct 2016 20:37:53 +0300 Subject: [PATCH 12/26] - fixed docker-compose scripts --- .../docker-compose-common.yml | 17 +++++------------ .../docker-compose-eventuate-local.yml | 10 ---------- .../docker-microservices/docker-compose.yml | 10 ---------- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/java-server/docker-microservices/docker-compose-common.yml b/java-server/docker-microservices/docker-compose-common.yml index ce25dec4..39a4a59a 100755 --- a/java-server/docker-microservices/docker-compose-common.yml +++ b/java-server/docker-microservices/docker-compose-common.yml @@ -1,6 +1,5 @@ apigateway: - image: java:openjdk-8u91-jdk - command: java -jar /app/api-gateway-service.jar + build: ./api-gateway-service/ ports: - "8080:8080" environment: @@ -9,30 +8,24 @@ apigateway: TASK_COMMANDSIDE_SERVICE_URL: http://taskcommandside:8080 TASK_QUERYSIDE_SERVICE_URL: http://taskqueryside:8080 - boardcommandside: - image: java:openjdk-8u91-jdk - command: java -jar /app/board-command-side-service.jar + build: ./board-command-side-service/ ports: - "8081:8080" taskcommandside: - image: java:openjdk-8u91-jdk - command: java -jar /app/task-command-side-service.jar + build: ./task-command-side-service/ ports: - "8082:8080" boardqueryside: - image: java:openjdk-8u91-jdk - command: java -jar /app/board-query-side-service.jar + build: ./board-query-side-service/ ports: - "8083:8080" environment: SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban -taskqueryside: - image: java:openjdk-8u91-jdk - command: java -jar /app/task-query-side-service.jar + build: ./task-query-side-service/ ports: - "8084:8080" environment: diff --git a/java-server/docker-microservices/docker-compose-eventuate-local.yml b/java-server/docker-microservices/docker-compose-eventuate-local.yml index fcb63b6b..d1e6b385 100644 --- a/java-server/docker-microservices/docker-compose-eventuate-local.yml +++ b/java-server/docker-microservices/docker-compose-eventuate-local.yml @@ -54,8 +54,6 @@ apigateway: extends: file: docker-compose-common.yml service: apigateway - volumes: - - ../api-gateway-service/build/libs:/app links: - boardcommandside - taskcommandside @@ -79,8 +77,6 @@ boardcommandside: extends: file: docker-compose-common.yml service: boardcommandside - volumes: - - ../board-command-side-service/build/libs:/app links: - mysql - kafka @@ -99,8 +95,6 @@ taskcommandside: extends: file: docker-compose-common.yml service: taskcommandside - volumes: - - ../task-command-side-service/build/libs:/app links: - mysql - kafka @@ -119,8 +113,6 @@ boardqueryside: extends: file: docker-compose-common.yml service: boardqueryside - volumes: - - ../board-query-side-service/build/libs:/app links: - mongodb - mysql @@ -140,8 +132,6 @@ taskqueryside: extends: file: docker-compose-common.yml service: taskqueryside - volumes: - - ../task-query-side-service/build/libs:/app links: - mongodb - mysql diff --git a/java-server/docker-microservices/docker-compose.yml b/java-server/docker-microservices/docker-compose.yml index bf06a02c..c82e453c 100755 --- a/java-server/docker-microservices/docker-compose.yml +++ b/java-server/docker-microservices/docker-compose.yml @@ -2,8 +2,6 @@ apigateway: extends: file: docker-compose-common.yml service: apigateway - volumes: - - ../api-gateway-service/build/libs:/app links: - boardcommandside - taskcommandside @@ -17,8 +15,6 @@ boardcommandside: extends: file: docker-compose-common.yml service: boardcommandside - volumes: - - ../board-command-side-service/build/libs:/app environment: EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} @@ -27,8 +23,6 @@ taskcommandside: extends: file: docker-compose-common.yml service: taskcommandside - volumes: - - ../task-command-side-service/build/libs:/app environment: EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} @@ -37,8 +31,6 @@ boardqueryside: extends: file: docker-compose-common.yml service: boardqueryside - volumes: - - ../board-query-side-service/build/libs:/app links: - mongodb environment: @@ -49,8 +41,6 @@ taskqueryside: extends: file: docker-compose-common.yml service: taskqueryside - volumes: - - ../task-query-side-service/build/libs:/app links: - mongodb environment: From 4d32f5ef6ab75f689576161194532fd4110305a2 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Tue, 11 Oct 2016 20:41:47 +0300 Subject: [PATCH 13/26] fixed paths in docker-compose-common script --- .../docker-microservices/docker-compose-common.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java-server/docker-microservices/docker-compose-common.yml b/java-server/docker-microservices/docker-compose-common.yml index 39a4a59a..94e811b7 100755 --- a/java-server/docker-microservices/docker-compose-common.yml +++ b/java-server/docker-microservices/docker-compose-common.yml @@ -1,5 +1,5 @@ apigateway: - build: ./api-gateway-service/ + build: ../api-gateway-service/ ports: - "8080:8080" environment: @@ -9,23 +9,23 @@ apigateway: TASK_QUERYSIDE_SERVICE_URL: http://taskqueryside:8080 boardcommandside: - build: ./board-command-side-service/ + build: ../board-command-side-service/ ports: - "8081:8080" taskcommandside: - build: ./task-command-side-service/ + build: ../task-command-side-service/ ports: - "8082:8080" boardqueryside: - build: ./board-query-side-service/ + build: ../board-query-side-service/ ports: - "8083:8080" environment: SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban - build: ./task-query-side-service/ + build: ../task-query-side-service/ ports: - "8084:8080" environment: From 421c8108153d79f8fa0f824e781c313dd07ab4bc Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Tue, 11 Oct 2016 20:43:07 +0300 Subject: [PATCH 14/26] fixed docker-compose-common script --- java-server/docker-microservices/docker-compose-common.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/java-server/docker-microservices/docker-compose-common.yml b/java-server/docker-microservices/docker-compose-common.yml index 94e811b7..1b720eb4 100755 --- a/java-server/docker-microservices/docker-compose-common.yml +++ b/java-server/docker-microservices/docker-compose-common.yml @@ -25,6 +25,7 @@ boardqueryside: environment: SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban +taskqueryside: build: ../task-query-side-service/ ports: - "8084:8080" From a82c619472c3e75c4b16f1f48a7e86d7f4475686 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Tue, 11 Oct 2016 20:44:04 +0300 Subject: [PATCH 15/26] added docker-compose build step to build-and-test-all script --- java-server/docker-microservices/_build-and-test-all.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/java-server/docker-microservices/_build-and-test-all.sh b/java-server/docker-microservices/_build-and-test-all.sh index 0905a49d..c5702f4e 100755 --- a/java-server/docker-microservices/_build-and-test-all.sh +++ b/java-server/docker-microservices/_build-and-test-all.sh @@ -50,6 +50,7 @@ if [ -z "$EVENTUATE_LOCAL" ] && [ -z "$EVENTUATE_API_KEY_ID" -o -z "$EVENTUATE_A exit -1 fi +${DOCKER_COMPOSE?} build ${DOCKER_COMPOSE?} up -d From 675d7fb2bd9165ef65c988399839ceba4b9d2222 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Tue, 11 Oct 2016 21:49:03 +0300 Subject: [PATCH 16/26] simplified Dockerfiles --- java-server/api-gateway-service/Dockerfile | 5 ++--- java-server/board-command-side-service/Dockerfile | 7 +++---- java-server/board-query-side-service/Dockerfile | 7 +++---- java-server/task-command-side-service/Dockerfile | 7 +++---- java-server/task-query-side-service/Dockerfile | 7 +++---- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/java-server/api-gateway-service/Dockerfile b/java-server/api-gateway-service/Dockerfile index e0d650a6..1245439c 100644 --- a/java-server/api-gateway-service/Dockerfile +++ b/java-server/api-gateway-service/Dockerfile @@ -1,5 +1,4 @@ FROM java:openjdk-8u91-jdk -RUN mkdir /app -WORKDIR /app -COPY ./build/libs /app CMD java ${JAVA_OPTS} -jar /app/api-gateway-service.jar +EXPOSE 8080 +COPY build/libs/api-gateway-service.jar . \ No newline at end of file diff --git a/java-server/board-command-side-service/Dockerfile b/java-server/board-command-side-service/Dockerfile index 189db789..ea45c552 100644 --- a/java-server/board-command-side-service/Dockerfile +++ b/java-server/board-command-side-service/Dockerfile @@ -1,5 +1,4 @@ FROM java:openjdk-8u91-jdk -RUN mkdir /app -WORKDIR /app -COPY ./build/libs /app -CMD java ${JAVA_OPTS} -jar /app/board-command-side-service.jar +CMD java ${JAVA_OPTS} -jar board-command-side-service.jar +EXPOSE 8080 +COPY build/libs/board-command-side-service.jar . \ No newline at end of file diff --git a/java-server/board-query-side-service/Dockerfile b/java-server/board-query-side-service/Dockerfile index 6c189588..f264f2b4 100644 --- a/java-server/board-query-side-service/Dockerfile +++ b/java-server/board-query-side-service/Dockerfile @@ -1,5 +1,4 @@ FROM java:openjdk-8u91-jdk -RUN mkdir /app -WORKDIR /app -COPY ./build/libs /app -CMD java ${JAVA_OPTS} -jar /app/board-query-side-service.jar +CMD java ${JAVA_OPTS} -jar board-query-side-service.jar +EXPOSE 8080 +COPY build/libs/board-query-side-service.jar . \ No newline at end of file diff --git a/java-server/task-command-side-service/Dockerfile b/java-server/task-command-side-service/Dockerfile index ad54db51..0e7ee789 100644 --- a/java-server/task-command-side-service/Dockerfile +++ b/java-server/task-command-side-service/Dockerfile @@ -1,5 +1,4 @@ FROM java:openjdk-8u91-jdk -RUN mkdir /app -WORKDIR /app -COPY ./build/libs /app -CMD java ${JAVA_OPTS} -jar /app/task-command-side-service.jar +CMD java ${JAVA_OPTS} -jar task-command-side-service.jar +EXPOSE 8080 +COPY build/libs/task-command-side-service.jar . \ No newline at end of file diff --git a/java-server/task-query-side-service/Dockerfile b/java-server/task-query-side-service/Dockerfile index 96b47588..cdecf0f6 100644 --- a/java-server/task-query-side-service/Dockerfile +++ b/java-server/task-query-side-service/Dockerfile @@ -1,5 +1,4 @@ FROM java:openjdk-8u91-jdk -RUN mkdir /app -WORKDIR /app -COPY ./build/libs /app -CMD java ${JAVA_OPTS} -jar /app/task-query-side-service.jar +CMD java ${JAVA_OPTS} -jar task-query-side-service.jar +EXPOSE 8080 +COPY build/libs/task-query-side-service.jar . \ No newline at end of file From 9a724062ccd09b56927c2ec2a747d8087caa1e58 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Tue, 11 Oct 2016 22:07:47 +0300 Subject: [PATCH 17/26] simplified Dockerfiles --- java-server/api-gateway-service/Dockerfile | 1 - java-server/board-command-side-service/Dockerfile | 1 - java-server/board-query-side-service/Dockerfile | 1 - java-server/task-command-side-service/Dockerfile | 1 - java-server/task-query-side-service/Dockerfile | 1 - 5 files changed, 5 deletions(-) diff --git a/java-server/api-gateway-service/Dockerfile b/java-server/api-gateway-service/Dockerfile index 1245439c..a04a4a4d 100644 --- a/java-server/api-gateway-service/Dockerfile +++ b/java-server/api-gateway-service/Dockerfile @@ -1,4 +1,3 @@ FROM java:openjdk-8u91-jdk CMD java ${JAVA_OPTS} -jar /app/api-gateway-service.jar -EXPOSE 8080 COPY build/libs/api-gateway-service.jar . \ No newline at end of file diff --git a/java-server/board-command-side-service/Dockerfile b/java-server/board-command-side-service/Dockerfile index ea45c552..f306997c 100644 --- a/java-server/board-command-side-service/Dockerfile +++ b/java-server/board-command-side-service/Dockerfile @@ -1,4 +1,3 @@ FROM java:openjdk-8u91-jdk CMD java ${JAVA_OPTS} -jar board-command-side-service.jar -EXPOSE 8080 COPY build/libs/board-command-side-service.jar . \ No newline at end of file diff --git a/java-server/board-query-side-service/Dockerfile b/java-server/board-query-side-service/Dockerfile index f264f2b4..e06e1542 100644 --- a/java-server/board-query-side-service/Dockerfile +++ b/java-server/board-query-side-service/Dockerfile @@ -1,4 +1,3 @@ FROM java:openjdk-8u91-jdk CMD java ${JAVA_OPTS} -jar board-query-side-service.jar -EXPOSE 8080 COPY build/libs/board-query-side-service.jar . \ No newline at end of file diff --git a/java-server/task-command-side-service/Dockerfile b/java-server/task-command-side-service/Dockerfile index 0e7ee789..d0cc1ea8 100644 --- a/java-server/task-command-side-service/Dockerfile +++ b/java-server/task-command-side-service/Dockerfile @@ -1,4 +1,3 @@ FROM java:openjdk-8u91-jdk CMD java ${JAVA_OPTS} -jar task-command-side-service.jar -EXPOSE 8080 COPY build/libs/task-command-side-service.jar . \ No newline at end of file diff --git a/java-server/task-query-side-service/Dockerfile b/java-server/task-query-side-service/Dockerfile index cdecf0f6..422cc5fb 100644 --- a/java-server/task-query-side-service/Dockerfile +++ b/java-server/task-query-side-service/Dockerfile @@ -1,4 +1,3 @@ FROM java:openjdk-8u91-jdk CMD java ${JAVA_OPTS} -jar task-query-side-service.jar -EXPOSE 8080 COPY build/libs/task-query-side-service.jar . \ No newline at end of file From 4b6894570250da51de4893552051101c94e5b1b1 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Tue, 11 Oct 2016 22:13:00 +0300 Subject: [PATCH 18/26] fixed api-gateway Dockerfile --- java-server/api-gateway-service/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-server/api-gateway-service/Dockerfile b/java-server/api-gateway-service/Dockerfile index a04a4a4d..199ae02c 100644 --- a/java-server/api-gateway-service/Dockerfile +++ b/java-server/api-gateway-service/Dockerfile @@ -1,3 +1,3 @@ FROM java:openjdk-8u91-jdk -CMD java ${JAVA_OPTS} -jar /app/api-gateway-service.jar +CMD java ${JAVA_OPTS} -jar api-gateway-service.jar COPY build/libs/api-gateway-service.jar . \ No newline at end of file From 6407eb35f6ce5e5537dd79749c72d3feca73177d Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Tue, 11 Oct 2016 14:48:07 -0700 Subject: [PATCH 19/26] Misc changes --- .../_build-and-test-all.sh | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/java-server/docker-microservices/_build-and-test-all.sh b/java-server/docker-microservices/_build-and-test-all.sh index 0905a49d..87bc7d58 100755 --- a/java-server/docker-microservices/_build-and-test-all.sh +++ b/java-server/docker-microservices/_build-and-test-all.sh @@ -2,6 +2,22 @@ set -e +if [ -z "$DOCKER_HOST_IP" ] ; then + if [ -z "$DOCKER_HOST" ] ; then + export DOCKER_HOST_IP=`hostname` + else + echo using ${DOCKER_HOST?} + XX=${DOCKER_HOST%\:*} + export DOCKER_HOST_IP=${XX#tcp\:\/\/} + fi + 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 + DOCKER_COMPOSE="docker-compose -p kanban-board" if [ "$1" = "-f" ] ; then @@ -24,17 +40,8 @@ if [ "$1" = "--no-rm" ] ; then shift fi -${DOCKER_COMPOSE?} up -d mongodb $EXTRA_INFRASTRUCTURE_SERVICES -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 +${DOCKER_COMPOSE?} up -d mongodb $EXTRA_INFRASTRUCTURE_SERVICES export SERVICE_HOST=$DOCKER_HOST_IP export DOCKER_PORT=8080 From 8f60762c0c2ed474dc8204be5927bb3cd6527f06 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Wed, 26 Oct 2016 19:19:21 +0300 Subject: [PATCH 20/26] - simplified services - removed standalone-service and related docker configs --- .../_build-and-test-all.sh | 6 -- .../board-command-side-service/pom.xml | 49 ---------- .../BoardCommandSideServiceConfiguration.java | 19 ---- .../main/BoardCommandSideServiceMain.java | 10 -- java-server/board-command-side/build.gradle | 13 --- java-server/board-command-side/pom.xml | 44 --------- java-server/board-query-side-service/pom.xml | 49 ---------- .../main/BoardQuerySideServiceMain.java | 10 -- java-server/board-query-side/build.gradle | 12 --- java-server/board-query-side/pom.xml | 38 -------- .../build.gradle | 5 +- .../boardservice/BoardServiceMain.java} | 18 ++-- .../boardservice/backend}/BoardAggregate.java | 4 +- .../backend/BoardBackendConfiguration.java} | 4 +- .../boardservice/backend}/BoardCommand.java | 2 +- .../boardservice/backend}/BoardService.java | 2 +- .../backend}/CreateBoardCommand.java | 2 +- .../boardservice/web/BoardController.java} | 8 +- .../src/main/resources/application.properties | 2 + .../src/main/resources/logback.xml | 0 .../build.gradle | 9 +- .../BoardViewServiceMain.java | 24 +++++ .../backend}/BoardRepository.java | 2 +- .../backend}/BoardUpdateService.java | 2 +- .../BoardViewBackendConfiguration.java} | 8 +- .../backend/BoardViewEventSubscriber.java} | 10 +- .../web/BoardViewController.java} | 5 +- .../src/main/resources/application.properties | 2 + .../src/main/resources/logback.xml | 0 java-server/build-and-run.sh | 16 ---- .../build-and-test-all-eventuate-local.sh | 0 .../build-and-test-all.sh | 0 .../docker-compose-common.yml | 0 .../docker-compose-eventuate-local.yml | 0 .../docker-compose.yml | 0 java-server/docker-monolithic/build.sh | 15 --- .../docker-monolithic/docker-compose.sh | 4 - .../docker-monolithic/docker-compose.yml | 20 ---- .../rest-api-integration-tests/build.gradle | 6 +- .../RestAPITestConfiguration.java | 42 +++++---- .../{docker-microservices => }/set-env.sh | 0 java-server/settings.gradle | 13 +-- java-server/standalone-service/build.gradle | 36 ------- java-server/standalone-service/pom.xml | 94 ------------------- .../StandaloneServiceConfiguration.java | 28 ------ .../main/StandaloneServiceMain.java | 11 --- .../task-command-side-service/build.gradle | 15 --- java-server/task-command-side-service/pom.xml | 49 ---------- .../TaskCommandSideServiceConfiguration.java | 19 ---- .../main/TaskCommandSideServiceMain.java | 10 -- java-server/task-command-side/pom.xml | 49 ---------- java-server/task-query-side-service/pom.xml | 54 ----------- .../main/TaskQuerySideServiceMain.java | 13 --- java-server/task-query-side/build.gradle | 12 --- java-server/task-query-side/pom.xml | 39 -------- .../build.gradle | 8 +- .../kanban/taskservice/TaskServiceMain.java} | 21 +++-- .../backend}/CompleteTaskCommand.java | 2 +- .../backend}/CreateTaskCommand.java | 2 +- .../backend}/DeleteTaskCommand.java | 2 +- .../backend}/MoveToBacklogTaskCommand.java | 2 +- .../backend}/ScheduleTaskCommand.java | 2 +- .../backend}/StartTaskCommand.java | 2 +- .../taskservice/backend}/TaskAggregate.java | 5 +- .../backend/TaskBackendConfiguration.java} | 4 +- .../taskservice/backend}/TaskCommand.java | 2 +- .../backend}/TaskHistoryService.java | 3 +- .../taskservice/backend}/TaskService.java | 2 +- .../backend}/UpdateTaskCommand.java | 2 +- .../taskservice/web/TaskController.java} | 9 +- .../src/main/resources/application.properties | 2 + .../src/main/resources/logback.xml | 21 +++++ .../build.gradle | 4 +- .../taskviewservice/TaskViewServiceMain.java | 24 +++++ .../backend}/TaskRepository.java | 2 +- .../backend}/TaskUpdateService.java | 2 +- .../TaskViewBackendConfiguration.java} | 8 +- .../backend/TaskViewEventSubscriber.java} | 14 +-- .../web/TaskViewController.java} | 5 +- .../wait-for-services.sh | 0 80 files changed, 210 insertions(+), 844 deletions(-) rename java-server/{docker-microservices => }/_build-and-test-all.sh (95%) delete mode 100755 java-server/board-command-side-service/pom.xml delete mode 100755 java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java delete mode 100755 java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/main/BoardCommandSideServiceMain.java delete mode 100755 java-server/board-command-side/build.gradle delete mode 100755 java-server/board-command-side/pom.xml delete mode 100755 java-server/board-query-side-service/pom.xml delete mode 100755 java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/main/BoardQuerySideServiceMain.java delete mode 100755 java-server/board-query-side/build.gradle delete mode 100755 java-server/board-query-side/pom.xml rename java-server/{task-query-side-service => board-service}/build.gradle (71%) mode change 100755 => 100644 rename java-server/{board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java => board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/BoardServiceMain.java} (51%) rename java-server/{board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board => board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend}/BoardAggregate.java (94%) rename java-server/{board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandSideConfiguration.java => board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardBackendConfiguration.java} (92%) rename java-server/{board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board => board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend}/BoardCommand.java (51%) rename java-server/{board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board => board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend}/BoardService.java (91%) rename java-server/{board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board => board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend}/CreateBoardCommand.java (86%) rename java-server/{board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandController.java => board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/web/BoardController.java} (79%) create mode 100644 java-server/board-service/src/main/resources/application.properties rename java-server/{board-command-side-service => board-service}/src/main/resources/logback.xml (100%) rename java-server/{board-query-side-service => board-view-service}/build.gradle (69%) mode change 100755 => 100644 create mode 100755 java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/BoardViewServiceMain.java rename java-server/{board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board => board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend}/BoardRepository.java (73%) rename java-server/{board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board => board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend}/BoardUpdateService.java (89%) rename java-server/{board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQuerySideConfiguration.java => board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java} (78%) rename java-server/{board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryWorkflow.java => board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewEventSubscriber.java} (64%) rename java-server/{board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryController.java => board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/web/BoardViewController.java} (86%) create mode 100644 java-server/board-view-service/src/main/resources/application.properties rename java-server/{standalone-service => board-view-service}/src/main/resources/logback.xml (100%) delete mode 100755 java-server/build-and-run.sh rename java-server/{docker-microservices => }/build-and-test-all-eventuate-local.sh (100%) rename java-server/{docker-microservices => }/build-and-test-all.sh (100%) rename java-server/{docker-microservices => }/docker-compose-common.yml (100%) rename java-server/{docker-microservices => }/docker-compose-eventuate-local.yml (100%) rename java-server/{docker-microservices => }/docker-compose.yml (100%) delete mode 100755 java-server/docker-monolithic/build.sh delete mode 100755 java-server/docker-monolithic/docker-compose.sh delete mode 100755 java-server/docker-monolithic/docker-compose.yml rename java-server/{docker-microservices => }/set-env.sh (100%) delete mode 100755 java-server/standalone-service/build.gradle delete mode 100755 java-server/standalone-service/pom.xml delete mode 100755 java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java delete mode 100755 java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/main/StandaloneServiceMain.java delete mode 100755 java-server/task-command-side-service/build.gradle delete mode 100755 java-server/task-command-side-service/pom.xml delete mode 100755 java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java delete mode 100755 java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/main/TaskCommandSideServiceMain.java delete mode 100755 java-server/task-command-side/pom.xml delete mode 100755 java-server/task-query-side-service/pom.xml delete mode 100755 java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/main/TaskQuerySideServiceMain.java delete mode 100755 java-server/task-query-side/build.gradle delete mode 100755 java-server/task-query-side/pom.xml rename java-server/{task-command-side => task-service}/build.gradle (72%) mode change 100755 => 100644 rename java-server/{task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/TaskServiceMain.java} (50%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/CompleteTaskCommand.java (89%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/CreateTaskCommand.java (86%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/DeleteTaskCommand.java (80%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/MoveToBacklogTaskCommand.java (86%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/ScheduleTaskCommand.java (89%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/StartTaskCommand.java (89%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/TaskAggregate.java (96%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandSideConfiguration.java => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskBackendConfiguration.java} (93%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/TaskCommand.java (51%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/TaskHistoryService.java (86%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/TaskService.java (97%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend}/UpdateTaskCommand.java (90%) rename java-server/{task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandController.java => task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/web/TaskController.java} (91%) create mode 100644 java-server/task-service/src/main/resources/application.properties create mode 100755 java-server/task-service/src/main/resources/logback.xml rename java-server/{board-command-side-service => task-view-service}/build.gradle (71%) mode change 100755 => 100644 create mode 100755 java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/TaskViewServiceMain.java rename java-server/{task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task => task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend}/TaskRepository.java (86%) rename java-server/{task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task => task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend}/TaskUpdateService.java (95%) rename java-server/{task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQuerySideConfiguration.java => task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java} (88%) rename java-server/{task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryWorkflow.java => task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewEventSubscriber.java} (83%) rename java-server/{task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryController.java => task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/web/TaskViewController.java} (87%) rename java-server/{docker-microservices => }/wait-for-services.sh (100%) diff --git a/java-server/docker-microservices/_build-and-test-all.sh b/java-server/_build-and-test-all.sh similarity index 95% rename from java-server/docker-microservices/_build-and-test-all.sh rename to java-server/_build-and-test-all.sh index 87bc7d58..65c8aa5c 100755 --- a/java-server/docker-microservices/_build-and-test-all.sh +++ b/java-server/_build-and-test-all.sh @@ -46,29 +46,23 @@ ${DOCKER_COMPOSE?} up -d mongodb $EXTRA_INFRASTRUCTURE_SERVICES export SERVICE_HOST=$DOCKER_HOST_IP export DOCKER_PORT=8080 -cd .. ./gradlew $* build -x :e2e-test:test -cd ./docker-microservices if [ -z "$EVENTUATE_LOCAL" ] && [ -z "$EVENTUATE_API_KEY_ID" -o -z "$EVENTUATE_API_KEY_SECRET" ] ; then echo You must set EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET exit -1 fi - ${DOCKER_COMPOSE?} up -d ./wait-for-services.sh $DOCKER_HOST_IP 8080 8081 8082 8083 8084 set -e -cd .. - ./gradlew -P ignoreE2EFailures=false $* :e2e-test:cleanTest :e2e-test:test -cd ./docker-microservices if [ $NO_RM = false ] ; then ${DOCKER_COMPOSE?} stop diff --git a/java-server/board-command-side-service/pom.xml b/java-server/board-command-side-service/pom.xml deleted file mode 100755 index 2254c491..00000000 --- a/java-server/board-command-side-service/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - net.chrisrichardson.eventstore.examples - kanban-app - 0.1.0-SNAPSHOT - - 4.0.0 - board-command-side-service - jar - board-command-side-service - - - - net.chrisrichardson.eventstore.examples - board-command-side - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-auth - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-swagger - ${project.parent.version} - - - - io.eventuate.client.java - eventuate-client-java-http-stomp-spring - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - - \ No newline at end of file diff --git a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java b/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java deleted file mode 100755 index 55fc8836..00000000 --- a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/BoardCommandSideServiceConfiguration.java +++ /dev/null @@ -1,19 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.boardcommandsideservice; - -import io.eventuate.javaclient.driver.EventuateDriverConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardCommandSideConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; - -@Configuration -@Import({BoardCommandSideConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) -@EnableAutoConfiguration -@ComponentScan -public class BoardCommandSideServiceConfiguration { - -} diff --git a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/main/BoardCommandSideServiceMain.java b/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/main/BoardCommandSideServiceMain.java deleted file mode 100755 index 20c3fedb..00000000 --- a/java-server/board-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardcommandsideservice/main/BoardCommandSideServiceMain.java +++ /dev/null @@ -1,10 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.boardcommandsideservice.main; - -import net.chrisrichardson.eventstore.examples.kanban.boardcommandsideservice.BoardCommandSideServiceConfiguration; -import org.springframework.boot.SpringApplication; - -public class BoardCommandSideServiceMain { - public static void main(String[] args) { - SpringApplication.run(BoardCommandSideServiceConfiguration.class, args); - } -} diff --git a/java-server/board-command-side/build.gradle b/java-server/board-command-side/build.gradle deleted file mode 100755 index df224f43..00000000 --- a/java-server/board-command-side/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -apply plugin: 'java' - -dependencies { - compile project(":common-board") - compile project(":common-web") - - compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" - - compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" - compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - - testCompile "junit:junit:4.11" -} diff --git a/java-server/board-command-side/pom.xml b/java-server/board-command-side/pom.xml deleted file mode 100755 index 56640de8..00000000 --- a/java-server/board-command-side/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - net.chrisrichardson.eventstore.examples - kanban-app - 0.1.0-SNAPSHOT - - 4.0.0 - board-command-side - jar - board-command-side - - - - net.chrisrichardson.eventstore.examples - common-board - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-web - ${project.parent.version} - - - - org.springframework.boot - spring-boot-starter-actuator - ${springBootVersion} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - - \ No newline at end of file diff --git a/java-server/board-query-side-service/pom.xml b/java-server/board-query-side-service/pom.xml deleted file mode 100755 index ad7ccfed..00000000 --- a/java-server/board-query-side-service/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - net.chrisrichardson.eventstore.examples - kanban-app - 0.1.0-SNAPSHOT - - 4.0.0 - board-query-side-service - jar - board-query-side-service - - - - net.chrisrichardson.eventstore.examples - board-query-side - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-auth - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-swagger - ${project.parent.version} - - - - io.eventuate.client.java - eventuate-client-java-http-stomp-spring - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - - \ No newline at end of file diff --git a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/main/BoardQuerySideServiceMain.java b/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/main/BoardQuerySideServiceMain.java deleted file mode 100755 index 854adb48..00000000 --- a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/main/BoardQuerySideServiceMain.java +++ /dev/null @@ -1,10 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.boardquerysideservice.main; - -import net.chrisrichardson.eventstore.examples.kanban.boardquerysideservice.BoardQuerySideServiceConfiguration; -import org.springframework.boot.SpringApplication; - -public class BoardQuerySideServiceMain { - public static void main(String[] args) { - SpringApplication.run(BoardQuerySideServiceConfiguration.class, args); - } -} diff --git a/java-server/board-query-side/build.gradle b/java-server/board-query-side/build.gradle deleted file mode 100755 index 1561b3db..00000000 --- a/java-server/board-query-side/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -apply plugin: 'java' - -dependencies { - compile project(":common-board") - compile project(":common-web") - - compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" - compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" - compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - - testCompile "junit:junit:4.11" -} \ No newline at end of file diff --git a/java-server/board-query-side/pom.xml b/java-server/board-query-side/pom.xml deleted file mode 100755 index b888ff37..00000000 --- a/java-server/board-query-side/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - net.chrisrichardson.eventstore.examples - kanban-app - 0.1.0-SNAPSHOT - - 4.0.0 - board-query-side - jar - board-query-side - - - - net.chrisrichardson.eventstore.examples - common-board - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-web - ${project.parent.version} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - - \ No newline at end of file diff --git a/java-server/task-query-side-service/build.gradle b/java-server/board-service/build.gradle old mode 100755 new mode 100644 similarity index 71% rename from java-server/task-query-side-service/build.gradle rename to java-server/board-service/build.gradle index 98130ed9..15fd0bda --- a/java-server/task-query-side-service/build.gradle +++ b/java-server/board-service/build.gradle @@ -4,10 +4,13 @@ apply plugin: EventuateDependencyPlugin apply plugin: 'spring-boot' dependencies { - compile project(":task-query-side") + compile project(":common-board") + compile project(":common-web") compile project(":common-swagger") compile project(":common-auth") + compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" + compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" diff --git a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/BoardServiceMain.java similarity index 51% rename from java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java rename to java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/BoardServiceMain.java index 9fa762ba..e2574777 100755 --- a/java-server/board-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardquerysideservice/BoardQuerySideServiceConfiguration.java +++ b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/BoardServiceMain.java @@ -1,18 +1,24 @@ -package net.chrisrichardson.eventstore.examples.kanban.boardquerysideservice; +package net.chrisrichardson.eventstore.examples.kanban.boardservice; import io.eventuate.javaclient.driver.EventuateDriverConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.boardservice.backend.BoardBackendConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.queryside.board.BoardQuerySideConfiguration; +import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({BoardQuerySideConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({BoardBackendConfiguration.class, + EventuateDriverConfiguration.class, + WebConfiguration.class, + AuthConfiguration.class, + CommonSwaggerConfiguration.class}) @EnableAutoConfiguration -@ComponentScan -public class BoardQuerySideServiceConfiguration { +public class BoardServiceMain { + public static void main(String[] args) { + SpringApplication.run(BoardServiceMain.class, args); + } } diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardAggregate.java b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardAggregate.java similarity index 94% rename from java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardAggregate.java rename to java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardAggregate.java index e2906df2..cdbdda82 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardAggregate.java +++ b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardAggregate.java @@ -1,10 +1,10 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardservice.backend; import io.eventuate.Event; import io.eventuate.EventUtil; import io.eventuate.ReflectiveMutableCommandProcessingAggregate; -import net.chrisrichardson.eventstore.examples.kanban.common.board.event.BoardCreatedEvent; import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; +import net.chrisrichardson.eventstore.examples.kanban.common.board.event.BoardCreatedEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandSideConfiguration.java b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardBackendConfiguration.java similarity index 92% rename from java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandSideConfiguration.java rename to java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardBackendConfiguration.java index 62673169..d43ebfe7 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandSideConfiguration.java +++ b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardBackendConfiguration.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardservice.backend; import io.eventuate.AggregateRepository; import io.eventuate.EventuateAggregateStore; @@ -16,7 +16,7 @@ @EnableEventHandlers @EnableAutoConfiguration(exclude = {MongoRepositoriesAutoConfiguration.class}) @ComponentScan -public class BoardCommandSideConfiguration { +public class BoardBackendConfiguration { @Bean public AggregateRepository boardAggregateRepository(EventuateAggregateStore eventStore) { diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommand.java b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardCommand.java similarity index 51% rename from java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommand.java rename to java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardCommand.java index 349b4082..435b84b6 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommand.java +++ b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardservice.backend; import io.eventuate.Command; diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardService.java b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardService.java similarity index 91% rename from java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardService.java rename to java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardService.java index cfe6cbc5..444a6365 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardService.java +++ b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/BoardService.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardservice.backend; import io.eventuate.AggregateRepository; import io.eventuate.EntityWithIdAndVersion; diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/CreateBoardCommand.java b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/CreateBoardCommand.java similarity index 86% rename from java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/CreateBoardCommand.java rename to java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/CreateBoardCommand.java index 173ba87d..55b88a80 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/CreateBoardCommand.java +++ b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/backend/CreateBoardCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; import org.apache.commons.lang.builder.ToStringBuilder; diff --git a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandController.java b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/web/BoardController.java similarity index 79% rename from java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandController.java rename to java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/web/BoardController.java index 14d2b1ca..ac08a4c7 100755 --- a/java-server/board-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/board/BoardCommandController.java +++ b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/web/BoardController.java @@ -1,6 +1,8 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardservice.web; import io.eventuate.EntityWithIdAndVersion; +import net.chrisrichardson.eventstore.examples.kanban.boardservice.backend.BoardAggregate; +import net.chrisrichardson.eventstore.examples.kanban.boardservice.backend.BoardService; import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; import net.chrisrichardson.eventstore.examples.kanban.common.board.model.BoardResponse; import org.slf4j.Logger; @@ -16,12 +18,12 @@ @RestController @RequestMapping(value = "/api") -public class BoardCommandController { +public class BoardController { @Autowired private BoardService boardService; - private static Logger log = LoggerFactory.getLogger(BoardCommandController.class); + private static Logger log = LoggerFactory.getLogger(BoardController.class); @RequestMapping(value = "/boards", method = POST) public CompletableFuture saveBoard(@RequestBody BoardInfo board) { diff --git a/java-server/board-service/src/main/resources/application.properties b/java-server/board-service/src/main/resources/application.properties new file mode 100644 index 00000000..96a5a590 --- /dev/null +++ b/java-server/board-service/src/main/resources/application.properties @@ -0,0 +1,2 @@ +spring.application.name=board-service +server.port=8081 \ No newline at end of file diff --git a/java-server/board-command-side-service/src/main/resources/logback.xml b/java-server/board-service/src/main/resources/logback.xml similarity index 100% rename from java-server/board-command-side-service/src/main/resources/logback.xml rename to java-server/board-service/src/main/resources/logback.xml diff --git a/java-server/board-query-side-service/build.gradle b/java-server/board-view-service/build.gradle old mode 100755 new mode 100644 similarity index 69% rename from java-server/board-query-side-service/build.gradle rename to java-server/board-view-service/build.gradle index ff8b0683..890f705d --- a/java-server/board-query-side-service/build.gradle +++ b/java-server/board-view-service/build.gradle @@ -2,15 +2,18 @@ apply plugin: VerifyMongoDBConfigurationPlugin apply plugin: VerifyEventStoreEnvironmentPlugin apply plugin: EventuateDependencyPlugin -apply plugin: 'spring-boot' +apply plugin: 'java' dependencies { - compile project(":board-query-side") + compile project(":common-board") + compile project(":common-web") compile project(":common-swagger") compile project(":common-auth") + + compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" testCompile "junit:junit:4.11" -} +} \ No newline at end of file diff --git a/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/BoardViewServiceMain.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/BoardViewServiceMain.java new file mode 100755 index 00000000..4426f081 --- /dev/null +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/BoardViewServiceMain.java @@ -0,0 +1,24 @@ +package net.chrisrichardson.eventstore.examples.kanban.boardviewservice; + +import io.eventuate.javaclient.driver.EventuateDriverConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.boardviewservice.backend.BoardViewBackendConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +@Configuration +@Import({BoardViewBackendConfiguration.class, + EventuateDriverConfiguration.class, + WebConfiguration.class, + AuthConfiguration.class, + CommonSwaggerConfiguration.class}) +@EnableAutoConfiguration +public class BoardViewServiceMain { + public static void main(String[] args) { + SpringApplication.run(BoardViewServiceMain.class, args); + } +} diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardRepository.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardRepository.java similarity index 73% rename from java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardRepository.java rename to java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardRepository.java index 46f28318..3954bc17 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardRepository.java +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardRepository.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardviewservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.board.model.Board; import org.springframework.data.mongodb.repository.MongoRepository; diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardUpdateService.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardUpdateService.java similarity index 89% rename from java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardUpdateService.java rename to java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardUpdateService.java index b266fa60..7a9f5f28 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardUpdateService.java +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardUpdateService.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardviewservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.board.BoardInfo; import net.chrisrichardson.eventstore.examples.kanban.common.board.model.Board; diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQuerySideConfiguration.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java similarity index 78% rename from java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQuerySideConfiguration.java rename to java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java index ebe096ec..f5a37fa5 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQuerySideConfiguration.java +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardviewservice.backend; import io.eventuate.javaclient.spring.EnableEventHandlers; @@ -16,11 +16,11 @@ @EnableAutoConfiguration @ComponentScan @EnableMongoRepositories -public class BoardQuerySideConfiguration { +public class BoardViewBackendConfiguration { @Bean - public BoardQueryWorkflow boardQueryWorkflow(BoardUpdateService boardInfoUpdateService) { - return new BoardQueryWorkflow(boardInfoUpdateService); + public BoardViewEventSubscriber boardQueryWorkflow(BoardUpdateService boardInfoUpdateService) { + return new BoardViewEventSubscriber(boardInfoUpdateService); } @Bean diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryWorkflow.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewEventSubscriber.java similarity index 64% rename from java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryWorkflow.java rename to java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewEventSubscriber.java index f0886427..9af57f32 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryWorkflow.java +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewEventSubscriber.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardviewservice.backend; import io.eventuate.DispatchedEvent; import io.eventuate.EventHandlerMethod; @@ -8,12 +8,12 @@ import org.slf4j.LoggerFactory; @EventSubscriber(id = "boardEventHandlers") -public class BoardQueryWorkflow{ +public class BoardViewEventSubscriber { private BoardUpdateService boardUpdateService; - private static Logger log = LoggerFactory.getLogger(BoardQueryWorkflow.class); + private static Logger log = LoggerFactory.getLogger(BoardViewEventSubscriber.class); - public BoardQueryWorkflow(BoardUpdateService boardInfoUpdateService) { + public BoardViewEventSubscriber(BoardUpdateService boardInfoUpdateService) { this.boardUpdateService = boardInfoUpdateService; } @@ -22,7 +22,7 @@ public void create(DispatchedEvent de) { BoardCreatedEvent event = de.getEvent(); String id = de.getEntityId(); - log.info("BoardQueryWorkflow got event : {}", de.getEvent()); + log.info("BoardViewEventSubscriber got event : {}", de.getEvent()); boardUpdateService.create(id, event.getBoardInfo()); } } \ No newline at end of file diff --git a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryController.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/web/BoardViewController.java similarity index 86% rename from java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryController.java rename to java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/web/BoardViewController.java index 89f47abe..dda7abce 100755 --- a/java-server/board-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/board/BoardQueryController.java +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/web/BoardViewController.java @@ -1,5 +1,6 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.board; +package net.chrisrichardson.eventstore.examples.kanban.boardviewservice.web; +import net.chrisrichardson.eventstore.examples.kanban.boardviewservice.backend.BoardRepository; import net.chrisrichardson.eventstore.examples.kanban.common.board.model.BoardQueryResponse; import net.chrisrichardson.eventstore.examples.kanban.common.board.model.BoardsQueryResponse; import org.springframework.beans.factory.annotation.Autowired; @@ -15,7 +16,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.GET; @RestController -public class BoardQueryController { +public class BoardViewController { @Autowired private BoardRepository boardRepository; diff --git a/java-server/board-view-service/src/main/resources/application.properties b/java-server/board-view-service/src/main/resources/application.properties new file mode 100644 index 00000000..df2161d6 --- /dev/null +++ b/java-server/board-view-service/src/main/resources/application.properties @@ -0,0 +1,2 @@ +spring.application.name=board-view-service +server.port=8083 \ No newline at end of file diff --git a/java-server/standalone-service/src/main/resources/logback.xml b/java-server/board-view-service/src/main/resources/logback.xml similarity index 100% rename from java-server/standalone-service/src/main/resources/logback.xml rename to java-server/board-view-service/src/main/resources/logback.xml diff --git a/java-server/build-and-run.sh b/java-server/build-and-run.sh deleted file mode 100755 index 5fe47462..00000000 --- a/java-server/build-and-run.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -if [ -z "$EVENTUATE_API_KEY_ID" -o -z "$EVENTUATE_API_KEY_SECRET" ] ; then - echo You must set EVENTUATE_API_KEY_ID and EVENTUATE_API_KEY_SECRET - exit -1 -fi - -echo "arguments" $* - -./gradlew $* clean build -xtest - -cd ./standalone-service - -echo "arguments" $* - -../gradlew $* clean copyAngularJS bootRun \ No newline at end of file diff --git a/java-server/docker-microservices/build-and-test-all-eventuate-local.sh b/java-server/build-and-test-all-eventuate-local.sh similarity index 100% rename from java-server/docker-microservices/build-and-test-all-eventuate-local.sh rename to java-server/build-and-test-all-eventuate-local.sh diff --git a/java-server/docker-microservices/build-and-test-all.sh b/java-server/build-and-test-all.sh similarity index 100% rename from java-server/docker-microservices/build-and-test-all.sh rename to java-server/build-and-test-all.sh diff --git a/java-server/docker-microservices/docker-compose-common.yml b/java-server/docker-compose-common.yml similarity index 100% rename from java-server/docker-microservices/docker-compose-common.yml rename to java-server/docker-compose-common.yml diff --git a/java-server/docker-microservices/docker-compose-eventuate-local.yml b/java-server/docker-compose-eventuate-local.yml similarity index 100% rename from java-server/docker-microservices/docker-compose-eventuate-local.yml rename to java-server/docker-compose-eventuate-local.yml diff --git a/java-server/docker-microservices/docker-compose.yml b/java-server/docker-compose.yml similarity index 100% rename from java-server/docker-microservices/docker-compose.yml rename to java-server/docker-compose.yml diff --git a/java-server/docker-monolithic/build.sh b/java-server/docker-monolithic/build.sh deleted file mode 100755 index 49aca3ac..00000000 --- a/java-server/docker-monolithic/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -e - -OD=$(pwd) - -docker-compose up -d mongodb - -cd .. -./gradlew :standalone-service:clean :standalone-service:assemble - -cd $OD - -docker-compose stop - -echo "Build successfuly completed" diff --git a/java-server/docker-monolithic/docker-compose.sh b/java-server/docker-monolithic/docker-compose.sh deleted file mode 100755 index 8b886bf5..00000000 --- a/java-server/docker-monolithic/docker-compose.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e -./build.sh -docker-compose $* diff --git a/java-server/docker-monolithic/docker-compose.yml b/java-server/docker-monolithic/docker-compose.yml deleted file mode 100755 index cf47d070..00000000 --- a/java-server/docker-monolithic/docker-compose.yml +++ /dev/null @@ -1,20 +0,0 @@ -kanbanservice: - image: java:openjdk-8u91-jdk - working_dir: /app - volumes: - - ../standalone-service/build/libs:/app - command: java -jar /app/standalone-service.jar --spring.data.mongodb.uri=mongodb://mongodb:27017/kanban - ports: - - "8080:8080" - links: - - mongodb - environment: - EVENTUATE_API_KEY_ID: - EVENTUATE_API_KEY_SECRET: - -mongodb: - image: mongo:3.0.4 - hostname: mongodb - command: mongod --smallfiles - ports: - - "27017:27017" diff --git a/java-server/rest-api-integration-tests/build.gradle b/java-server/rest-api-integration-tests/build.gradle index 4034ea48..7b3c331c 100755 --- a/java-server/rest-api-integration-tests/build.gradle +++ b/java-server/rest-api-integration-tests/build.gradle @@ -1,10 +1,8 @@ apply plugin: 'java' dependencies { - testCompile project(":board-command-side") - testCompile project(":board-query-side") - testCompile project(":task-command-side") - testCompile project(":task-query-side") + testCompile project(":common-board") + testCompile project(":common-task") testCompile project(":test-utils") testCompile "junit:junit:4.11" diff --git a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java index 45516568..269050a1 100755 --- a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java +++ b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java @@ -2,11 +2,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.eventuate.javaclient.spring.jdbc.EventuateJdbcEventStoreConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardCommandSideConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskCommandSideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebsocketEventsTranslator; -import net.chrisrichardson.eventstore.examples.kanban.queryside.board.BoardQuerySideConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.queryside.task.TaskQuerySideConfiguration; import net.chrisrichardson.eventstore.examples.kanban.testutil.BasicWebTestConfiguration; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; @@ -20,29 +16,35 @@ import org.springframework.messaging.simp.SimpMessagingTemplate; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.web.client.RestTemplate; + import java.util.Collections; @Configuration @EnableWebSecurity -@Import({EventuateJdbcEventStoreConfiguration.class, BasicWebTestConfiguration.class, BoardQuerySideConfiguration.class, TaskQuerySideConfiguration.class, BoardCommandSideConfiguration.class, TaskCommandSideConfiguration.class}) +@Import({EventuateJdbcEventStoreConfiguration.class, + BasicWebTestConfiguration.class, +/* BoardQuerySideConfiguration.class, + TaskQuerySideConfiguration.class, + BoardCommandSideConfiguration.class, + TaskCommandSideConfiguration.class*/}) public class RestAPITestConfiguration { - @Bean - public WebsocketEventsTranslator websocketEventsTranslator(SimpMessagingTemplate template) { - return new WebsocketEventsTranslator(template); - } + @Bean + public WebsocketEventsTranslator websocketEventsTranslator(SimpMessagingTemplate template) { + return new WebsocketEventsTranslator(template); + } - @Bean - public RestTemplate restTemplate() { - // we have to define Apache HTTP client to use the PATCH verb - MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); - converter.setSupportedMediaTypes(MediaType.parseMediaTypes("application/json")); - converter.setObjectMapper(new ObjectMapper()); + @Bean + public RestTemplate restTemplate() { + // we have to define Apache HTTP client to use the PATCH verb + MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); + converter.setSupportedMediaTypes(MediaType.parseMediaTypes("application/json")); + converter.setObjectMapper(new ObjectMapper()); - HttpClient httpClient = HttpClients.createDefault(); - RestTemplate restTemplate = new RestTemplate(Collections.>singletonList(converter)); - restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory(httpClient)); + HttpClient httpClient = HttpClients.createDefault(); + RestTemplate restTemplate = new RestTemplate(Collections.>singletonList(converter)); + restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory(httpClient)); - return restTemplate; - } + return restTemplate; + } } diff --git a/java-server/docker-microservices/set-env.sh b/java-server/set-env.sh similarity index 100% rename from java-server/docker-microservices/set-env.sh rename to java-server/set-env.sh diff --git a/java-server/settings.gradle b/java-server/settings.gradle index fd0520b4..57cf7eb1 100755 --- a/java-server/settings.gradle +++ b/java-server/settings.gradle @@ -6,20 +6,15 @@ include 'common-task' include 'common-web' include 'common-swagger' -include 'board-command-side' -include 'task-command-side' -include 'board-query-side' -include 'task-query-side' +include 'board-service' +include 'board-view-service' +include 'task-service' +include 'task-view-service' include 'standalone-service' include 'rest-api-integration-tests' include 'api-gateway-service' include 'common-auth' include 'common-websocket' -include 'board-command-side-service' -include 'board-query-side-service' -include 'task-command-side-service' -include 'task-query-side-service' include 'common-auth-controller' include 'e2e-test' - diff --git a/java-server/standalone-service/build.gradle b/java-server/standalone-service/build.gradle deleted file mode 100755 index 36dd1a85..00000000 --- a/java-server/standalone-service/build.gradle +++ /dev/null @@ -1,36 +0,0 @@ -apply plugin: VerifyMongoDBConfigurationPlugin -apply plugin: VerifyEventStoreEnvironmentPlugin -apply plugin: EventuateDependencyPlugin - -apply plugin: 'spring-boot' - -dependencies { - compile project(":board-command-side") - compile project(":task-command-side") - compile project(":board-query-side") - compile project(":task-query-side") - compile project(":common-auth-controller") - compile project(":common-websocket") - compile project(":common-swagger") - - compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" - compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - - testCompile "junit:junit:4.11" - testCompile "org.springframework.boot:spring-boot-starter-test" -} - -test { - ignoreFailures true -} - -task copyAngularJS(type: Copy) { - from "../../prebuilt-angularjs-client" - into "build/resources/main/static" -} - -jar.dependsOn(copyAngularJS) - -bootRun { - systemProperties System.properties -} \ No newline at end of file diff --git a/java-server/standalone-service/pom.xml b/java-server/standalone-service/pom.xml deleted file mode 100755 index f7caea67..00000000 --- a/java-server/standalone-service/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - net.chrisrichardson.eventstore.examples - kanban-app - 0.1.0-SNAPSHOT - - 4.0.0 - standalone-service - jar - standalone-service - - - - net.chrisrichardson.eventstore.examples - board-command-side - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - task-command-side - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - board-query-side - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - task-query-side - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-auth-controller - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-websocket - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-swagger - ${project.parent.version} - - - - io.eventuate.client.java - eventuate-client-java-http-stomp-spring - - - - org.apache.httpcomponents - httpclient - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - maven-resources-plugin - 2.7 - - - copy-resources - validate - - copy-resources - - - ${basedir}/target/classes/static - - - ../../prebuilt-angularjs-client - - - - - - - - - \ No newline at end of file diff --git a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java b/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java deleted file mode 100755 index 710b5757..00000000 --- a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/StandaloneServiceConfiguration.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.standalone; - -import io.eventuate.javaclient.driver.EventuateDriverConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardCommandSideConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskCommandSideConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebSocketConfig; -import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebSocketSecurityConfig; -import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebsocketEventsTranslator; -import net.chrisrichardson.eventstore.examples.kanban.queryside.board.BoardQuerySideConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.queryside.task.TaskQuerySideConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.messaging.simp.SimpMessagingTemplate; - -@Configuration -@Import({EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class, BoardQuerySideConfiguration.class, TaskQuerySideConfiguration.class, BoardCommandSideConfiguration.class, TaskCommandSideConfiguration.class, CommonSwaggerConfiguration.class}) -@ComponentScan -public class StandaloneServiceConfiguration { - @Bean - public WebsocketEventsTranslator websocketEventsTranslator(SimpMessagingTemplate template) { - return new WebsocketEventsTranslator(template); - } -} \ No newline at end of file diff --git a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/main/StandaloneServiceMain.java b/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/main/StandaloneServiceMain.java deleted file mode 100755 index b9d4eb1a..00000000 --- a/java-server/standalone-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/standalone/main/StandaloneServiceMain.java +++ /dev/null @@ -1,11 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.standalone.main; - -import net.chrisrichardson.eventstore.examples.kanban.standalone.StandaloneServiceConfiguration; -import org.springframework.boot.SpringApplication; - -public class StandaloneServiceMain { - public static void main(String[] args) { - SpringApplication.run(StandaloneServiceConfiguration.class, args); - } - -} diff --git a/java-server/task-command-side-service/build.gradle b/java-server/task-command-side-service/build.gradle deleted file mode 100755 index 1db45a5a..00000000 --- a/java-server/task-command-side-service/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -apply plugin: VerifyEventStoreEnvironmentPlugin -apply plugin: EventuateDependencyPlugin - -apply plugin: 'spring-boot' - -dependencies { - compile project(":task-command-side") - compile project(":common-swagger") - compile project(":common-auth") - - compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" - compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - - testCompile "junit:junit:4.11" -} \ No newline at end of file diff --git a/java-server/task-command-side-service/pom.xml b/java-server/task-command-side-service/pom.xml deleted file mode 100755 index 44e73ffe..00000000 --- a/java-server/task-command-side-service/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - net.chrisrichardson.eventstore.examples - kanban-app - 0.1.0-SNAPSHOT - - 4.0.0 - task-command-side-service - jar - task-command-side-service - - - - net.chrisrichardson.eventstore.examples - task-command-side - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-auth - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-swagger - ${project.parent.version} - - - - io.eventuate.client.java - eventuate-client-java-http-stomp-spring - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - - \ No newline at end of file diff --git a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java b/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java deleted file mode 100755 index d1f5e97d..00000000 --- a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/TaskCommandSideServiceConfiguration.java +++ /dev/null @@ -1,19 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.taskcommandsideservice; - -import io.eventuate.javaclient.driver.EventuateDriverConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskCommandSideConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; - - -@Configuration -@Import({TaskCommandSideConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) -@EnableAutoConfiguration -@ComponentScan -public class TaskCommandSideServiceConfiguration { -} diff --git a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/main/TaskCommandSideServiceMain.java b/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/main/TaskCommandSideServiceMain.java deleted file mode 100755 index 9827748c..00000000 --- a/java-server/task-command-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskcommandsideservice/main/TaskCommandSideServiceMain.java +++ /dev/null @@ -1,10 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.taskcommandsideservice.main; - -import net.chrisrichardson.eventstore.examples.kanban.taskcommandsideservice.TaskCommandSideServiceConfiguration; -import org.springframework.boot.SpringApplication; - -public class TaskCommandSideServiceMain { - public static void main(String[] args) { - SpringApplication.run(TaskCommandSideServiceConfiguration.class, args); - } -} diff --git a/java-server/task-command-side/pom.xml b/java-server/task-command-side/pom.xml deleted file mode 100755 index f9b31165..00000000 --- a/java-server/task-command-side/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - net.chrisrichardson.eventstore.examples - kanban-app - 0.1.0-SNAPSHOT - - 4.0.0 - task-command-side - jar - task-command-side - - - - net.chrisrichardson.eventstore.examples - common-task - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-web - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-auth - ${project.parent.version} - - - - org.springframework.boot - spring-boot-starter-actuator - ${springBootVersion} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - - \ No newline at end of file diff --git a/java-server/task-query-side-service/pom.xml b/java-server/task-query-side-service/pom.xml deleted file mode 100755 index ee3c659d..00000000 --- a/java-server/task-query-side-service/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - net.chrisrichardson.eventstore.examples - kanban-app - 0.1.0-SNAPSHOT - - 4.0.0 - task-query-side-service - jar - task-query-side-service - - - - net.chrisrichardson.eventstore.examples - task-query-side - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-web - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-auth - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-swagger - ${project.parent.version} - - - - io.eventuate.client.java - eventuate-client-java-http-stomp-spring - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - - \ No newline at end of file diff --git a/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/main/TaskQuerySideServiceMain.java b/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/main/TaskQuerySideServiceMain.java deleted file mode 100755 index 4200c7a8..00000000 --- a/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/main/TaskQuerySideServiceMain.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.chrisrichardson.eventstore.examples.kanban.taskquerysideservice.main; - -import net.chrisrichardson.eventstore.examples.kanban.taskquerysideservice.TaskQuerySideServiceConfiguration; -import org.springframework.boot.SpringApplication; - -/** - * Created by Main on 19.01.2016. - */ -public class TaskQuerySideServiceMain { - public static void main(String[] args) { - SpringApplication.run(TaskQuerySideServiceConfiguration.class, args); - } -} diff --git a/java-server/task-query-side/build.gradle b/java-server/task-query-side/build.gradle deleted file mode 100755 index d89675de..00000000 --- a/java-server/task-query-side/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -apply plugin: 'java' - -dependencies { - compile project(":common-task") - compile project(":common-web") - - compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" - compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" - compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - - testCompile "junit:junit:4.11" -} \ No newline at end of file diff --git a/java-server/task-query-side/pom.xml b/java-server/task-query-side/pom.xml deleted file mode 100755 index 01a8980e..00000000 --- a/java-server/task-query-side/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - net.chrisrichardson.eventstore.examples - kanban-app - 0.1.0-SNAPSHOT - - 4.0.0 - task-query-side - jar - task-query-side - - - - net.chrisrichardson.eventstore.examples - common-task - ${project.parent.version} - - - net.chrisrichardson.eventstore.examples - common-web - ${project.parent.version} - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - - \ No newline at end of file diff --git a/java-server/task-command-side/build.gradle b/java-server/task-service/build.gradle old mode 100755 new mode 100644 similarity index 72% rename from java-server/task-command-side/build.gradle rename to java-server/task-service/build.gradle index a53b3831..0fb3cce5 --- a/java-server/task-command-side/build.gradle +++ b/java-server/task-service/build.gradle @@ -1,9 +1,13 @@ -apply plugin: 'java' +apply plugin: VerifyEventStoreEnvironmentPlugin +apply plugin: EventuateDependencyPlugin + +apply plugin: 'spring-boot' dependencies { compile project(":common-task") compile project(":common-web") compile project(":common-auth") + compile project(":common-swagger") compile "io.eventuate.client.java:eventuate-client-java-spring:$eventuateClientVersion" @@ -11,4 +15,4 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" testCompile "junit:junit:4.11" -} +} \ No newline at end of file diff --git a/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/TaskServiceMain.java similarity index 50% rename from java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/TaskServiceMain.java index a8e8c1e9..3e0070dd 100755 --- a/java-server/task-query-side-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskquerysideservice/TaskQuerySideServiceConfiguration.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/TaskServiceMain.java @@ -1,21 +1,24 @@ -package net.chrisrichardson.eventstore.examples.kanban.taskquerysideservice; +package net.chrisrichardson.eventstore.examples.kanban.taskservice; import io.eventuate.javaclient.driver.EventuateDriverConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.queryside.task.TaskQuerySideConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.taskservice.backend.TaskBackendConfiguration; +import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -/** - * Created by Main on 19.01.2016. - */ @Configuration -@Import({TaskQuerySideConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, CommonSwaggerConfiguration.class}) +@Import({TaskBackendConfiguration.class, + EventuateDriverConfiguration.class, + WebConfiguration.class, + AuthConfiguration.class, + CommonSwaggerConfiguration.class}) @EnableAutoConfiguration -@ComponentScan -public class TaskQuerySideServiceConfiguration { +public class TaskServiceMain { + public static void main(String[] args) { + SpringApplication.run(TaskServiceMain.class, args); + } } diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CompleteTaskCommand.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/CompleteTaskCommand.java similarity index 89% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CompleteTaskCommand.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/CompleteTaskCommand.java index f8af8344..52dd6d40 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CompleteTaskCommand.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/CompleteTaskCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CreateTaskCommand.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/CreateTaskCommand.java similarity index 86% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CreateTaskCommand.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/CreateTaskCommand.java index f8a670e1..636dbfde 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/CreateTaskCommand.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/CreateTaskCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskInfo; import org.apache.commons.lang.builder.ToStringBuilder; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/DeleteTaskCommand.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/DeleteTaskCommand.java similarity index 80% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/DeleteTaskCommand.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/DeleteTaskCommand.java index e847ec7b..4e68c59a 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/DeleteTaskCommand.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/DeleteTaskCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/MoveToBacklogTaskCommand.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/MoveToBacklogTaskCommand.java similarity index 86% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/MoveToBacklogTaskCommand.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/MoveToBacklogTaskCommand.java index 670c7b34..e7303924 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/MoveToBacklogTaskCommand.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/MoveToBacklogTaskCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/ScheduleTaskCommand.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/ScheduleTaskCommand.java similarity index 89% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/ScheduleTaskCommand.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/ScheduleTaskCommand.java index a8ca4f6a..81c7123a 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/ScheduleTaskCommand.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/ScheduleTaskCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/StartTaskCommand.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/StartTaskCommand.java similarity index 89% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/StartTaskCommand.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/StartTaskCommand.java index fb571200..5608e0f6 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/StartTaskCommand.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/StartTaskCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import org.apache.commons.lang.builder.ToStringBuilder; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskAggregate.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskAggregate.java similarity index 96% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskAggregate.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskAggregate.java index 86f3d8f0..beaef12f 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskAggregate.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskAggregate.java @@ -1,9 +1,10 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import io.eventuate.Event; import io.eventuate.EventUtil; import io.eventuate.ReflectiveMutableCommandProcessingAggregate; -import net.chrisrichardson.eventstore.examples.kanban.common.task.*; +import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskInfo; +import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskStatus; import net.chrisrichardson.eventstore.examples.kanban.common.task.event.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandSideConfiguration.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskBackendConfiguration.java similarity index 93% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandSideConfiguration.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskBackendConfiguration.java index f5304f8b..e9bdeae8 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandSideConfiguration.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskBackendConfiguration.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import io.eventuate.AggregateRepository; import io.eventuate.EventuateAggregateStore; @@ -16,7 +16,7 @@ @EnableAutoConfiguration(exclude = {MongoRepositoriesAutoConfiguration.class}) @ComponentScan @EnableEventHandlers -public class TaskCommandSideConfiguration { +public class TaskBackendConfiguration { @Bean public AggregateRepository taskAggregateRepository(EventuateAggregateStore eventStore) { diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommand.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskCommand.java similarity index 51% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommand.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskCommand.java index 03fc88e0..6cb757a8 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommand.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import io.eventuate.Command; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskHistoryService.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskHistoryService.java similarity index 86% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskHistoryService.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskHistoryService.java index 35b526f8..6a1a670c 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskHistoryService.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskHistoryService.java @@ -1,7 +1,8 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import io.eventuate.EntityWithMetadata; import io.eventuate.EventuateAggregateStore; + import java.util.concurrent.CompletableFuture; public class TaskHistoryService { diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskService.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskService.java similarity index 97% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskService.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskService.java index 42f2b4f5..55b4eff2 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskService.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/TaskService.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import io.eventuate.AggregateRepository; import io.eventuate.EntityWithIdAndVersion; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/UpdateTaskCommand.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/UpdateTaskCommand.java similarity index 90% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/UpdateTaskCommand.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/UpdateTaskCommand.java index cd339d38..041baabf 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/UpdateTaskCommand.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/backend/UpdateTaskCommand.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.model.AuditEntry; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskDetails; diff --git a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandController.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/web/TaskController.java similarity index 91% rename from java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandController.java rename to java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/web/TaskController.java index bbc553a5..aa892f2e 100755 --- a/java-server/task-command-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/commandside/task/TaskCommandController.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/web/TaskController.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.commandside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskservice.web; import io.eventuate.EntityWithIdAndVersion; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskDetails; @@ -7,6 +7,9 @@ import net.chrisrichardson.eventstore.examples.kanban.common.task.model.HistoryEvent; import net.chrisrichardson.eventstore.examples.kanban.common.task.model.HistoryResponse; import net.chrisrichardson.eventstore.examples.kanban.common.task.model.TaskResponse; +import net.chrisrichardson.eventstore.examples.kanban.taskservice.backend.TaskAggregate; +import net.chrisrichardson.eventstore.examples.kanban.taskservice.backend.TaskHistoryService; +import net.chrisrichardson.eventstore.examples.kanban.taskservice.backend.TaskService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -24,14 +27,14 @@ @RestController @RequestMapping(value = "/api") -public class TaskCommandController { +public class TaskController { @Autowired private TaskService taskService; @Autowired private TaskHistoryService taskHistoryService; - private static Logger log = LoggerFactory.getLogger(TaskCommandController.class); + private static Logger log = LoggerFactory.getLogger(TaskController.class); @RequestMapping(value = "/tasks", method = POST) public CompletableFuture saveTask(@RequestBody TaskInfo task) { diff --git a/java-server/task-service/src/main/resources/application.properties b/java-server/task-service/src/main/resources/application.properties new file mode 100644 index 00000000..f387448e --- /dev/null +++ b/java-server/task-service/src/main/resources/application.properties @@ -0,0 +1,2 @@ +spring.application.name=task-service +server.port=8082 \ No newline at end of file diff --git a/java-server/task-service/src/main/resources/logback.xml b/java-server/task-service/src/main/resources/logback.xml new file mode 100755 index 00000000..84cbb835 --- /dev/null +++ b/java-server/task-service/src/main/resources/logback.xml @@ -0,0 +1,21 @@ + + + + + + + + %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-server/board-command-side-service/build.gradle b/java-server/task-view-service/build.gradle old mode 100755 new mode 100644 similarity index 71% rename from java-server/board-command-side-service/build.gradle rename to java-server/task-view-service/build.gradle index f980f0db..948d04a8 --- a/java-server/board-command-side-service/build.gradle +++ b/java-server/task-view-service/build.gradle @@ -4,10 +4,12 @@ apply plugin: EventuateDependencyPlugin apply plugin: 'spring-boot' dependencies { - compile project(":board-command-side") + compile project(":common-task") + compile project(":common-web") compile project(":common-swagger") compile project(":common-auth") + compile "org.springframework.boot:spring-boot-starter-data-mongodb:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" diff --git a/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/TaskViewServiceMain.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/TaskViewServiceMain.java new file mode 100755 index 00000000..c5802da9 --- /dev/null +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/TaskViewServiceMain.java @@ -0,0 +1,24 @@ +package net.chrisrichardson.eventstore.examples.kanban.taskviewservice; + +import io.eventuate.javaclient.driver.EventuateDriverConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.taskviewservice.backend.TaskViewBackendConfiguration; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +@Configuration +@Import({TaskViewBackendConfiguration.class, + EventuateDriverConfiguration.class, + WebConfiguration.class, + AuthConfiguration.class, + CommonSwaggerConfiguration.class}) +@EnableAutoConfiguration +public class TaskViewServiceMain { + public static void main(String[] args) { + SpringApplication.run(TaskViewServiceMain.class, args); + } +} diff --git a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskRepository.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskRepository.java similarity index 86% rename from java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskRepository.java rename to java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskRepository.java index 5d7232e4..7ccd4f7f 100755 --- a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskRepository.java +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskRepository.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskviewservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskStatus; import net.chrisrichardson.eventstore.examples.kanban.common.task.model.Task; diff --git a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskUpdateService.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskUpdateService.java similarity index 95% rename from java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskUpdateService.java rename to java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskUpdateService.java index ffe2f49f..45577d98 100755 --- a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskUpdateService.java +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskUpdateService.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskviewservice.backend; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskInfo; import net.chrisrichardson.eventstore.examples.kanban.common.task.model.Task; diff --git a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQuerySideConfiguration.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java similarity index 88% rename from java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQuerySideConfiguration.java rename to java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java index dbe96ef2..3c8b64af 100755 --- a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQuerySideConfiguration.java +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskviewservice.backend; import io.eventuate.javaclient.spring.EnableEventHandlers; import org.springframework.beans.factory.BeanFactory; @@ -21,12 +21,12 @@ @ComponentScan @EnableMongoRepositories @EnableEventHandlers -public class TaskQuerySideConfiguration { +public class TaskViewBackendConfiguration { @Bean - public TaskQueryWorkflow taskQueryWorkflow(TaskUpdateService taskUpdateService) { - return new TaskQueryWorkflow(taskUpdateService); + public TaskViewEventSubscriber taskQueryWorkflow(TaskUpdateService taskUpdateService) { + return new TaskViewEventSubscriber(taskUpdateService); } @Bean diff --git a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryWorkflow.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewEventSubscriber.java similarity index 83% rename from java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryWorkflow.java rename to java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewEventSubscriber.java index 122ca0c2..3c722657 100755 --- a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryWorkflow.java +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewEventSubscriber.java @@ -1,4 +1,4 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskviewservice.backend; import io.eventuate.DispatchedEvent; import io.eventuate.Event; @@ -11,15 +11,15 @@ import org.slf4j.LoggerFactory; @EventSubscriber(id = "taskEventHandlers") -public class TaskQueryWorkflow { +public class TaskViewEventSubscriber { private TaskUpdateService taskUpdateService; - public TaskQueryWorkflow(TaskUpdateService taskUpdateService) { + public TaskViewEventSubscriber(TaskUpdateService taskUpdateService) { this.taskUpdateService = taskUpdateService; } - private static Logger log = LoggerFactory.getLogger(TaskQueryWorkflow.class); + private static Logger log = LoggerFactory.getLogger(TaskViewEventSubscriber.class); @EventHandlerMethod public void create(DispatchedEvent de) { @@ -30,7 +30,7 @@ public void create(DispatchedEvent de) { @EventHandlerMethod public void update(DispatchedEvent de) { - log.info("TaskQueryWorkflow got event : {}", de.getEvent()); + log.info("TaskViewEventSubscriber got event : {}", de.getEvent()); TaskInfo taskInfo = new TaskInfo(); taskInfo.setTaskDetails(de.getEvent().getTaskDetails()); taskInfo.setUpdate(de.getEvent().getUpdate()); @@ -45,7 +45,7 @@ public void complete(DispatchedEvent de) { @EventHandlerMethod public void delete(DispatchedEvent de) { - log.info("TaskQueryWorkflow got event : {}", de.getEvent()); + log.info("TaskViewEventSubscriber got event : {}", de.getEvent()); taskUpdateService.delete(de.getEntityId()); } @@ -79,7 +79,7 @@ private void processChangeStatusEvent(DispatchedEvent de, TaskInfo taskInfo) { - log.info("TaskQueryWorkflow got event : {}", de.getEvent()); + log.info("TaskViewEventSubscriber got event : {}", de.getEvent()); taskUpdateService.update(de.getEntityId(), taskInfo); } } \ No newline at end of file diff --git a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryController.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/web/TaskViewController.java similarity index 87% rename from java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryController.java rename to java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/web/TaskViewController.java index 4c53d72e..68aa14f9 100755 --- a/java-server/task-query-side/src/main/java/net/chrisrichardson/eventstore/examples/kanban/queryside/task/TaskQueryController.java +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/web/TaskViewController.java @@ -1,7 +1,8 @@ -package net.chrisrichardson.eventstore.examples.kanban.queryside.task; +package net.chrisrichardson.eventstore.examples.kanban.taskviewservice.web; import net.chrisrichardson.eventstore.examples.kanban.common.task.TaskStatus; import net.chrisrichardson.eventstore.examples.kanban.common.task.model.BacklogResponse; +import net.chrisrichardson.eventstore.examples.kanban.taskviewservice.backend.TaskRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; @@ -15,7 +16,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.GET; @RestController -public class TaskQueryController { +public class TaskViewController { @Autowired private TaskRepository taskRepository; diff --git a/java-server/docker-microservices/wait-for-services.sh b/java-server/wait-for-services.sh similarity index 100% rename from java-server/docker-microservices/wait-for-services.sh rename to java-server/wait-for-services.sh From f817cfc7667dc0d2e665a5b5c229b71e808738e2 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Fri, 28 Oct 2016 23:05:30 +0300 Subject: [PATCH 21/26] - added Dockerfiles --- java-server/api-gateway-service/Dockerfile | 4 ++++ java-server/board-service/Dockerfile | 4 ++++ java-server/board-service/build.gradle | 5 ++++- .../web/BoardWebConfiguration.java | 12 ++++++++++++ java-server/board-view-service/Dockerfile | 4 ++++ .../backend/BoardViewBackendConfiguration.java | 2 -- .../web/BoardViewWebConfiguration.java | 12 ++++++++++++ java-server/docker-compose-common.yml | 15 +++++---------- java-server/docker/Dockerfile | 6 ------ java-server/docker/_build.sh | 12 ------------ java-server/docker/build-images.sh | 18 ------------------ java-server/docker/create-services.sh | 2 -- java-server/gradle.properties | 4 ++-- .../rest-api-integration-tests/build.gradle | 7 +++++-- .../RestAPITestConfiguration.java | 17 +++++++++++------ .../src/test/resources/logback.xml | 6 +++++- java-server/task-service/Dockerfile | 4 ++++ .../taskservice/web/TaskWebConfiguration.java | 12 ++++++++++++ java-server/task-view-service/Dockerfile | 4 ++++ .../backend/TaskViewBackendConfiguration.java | 2 -- .../web/TaskViewWebConfiguration.java | 12 ++++++++++++ 21 files changed, 100 insertions(+), 64 deletions(-) create mode 100644 java-server/api-gateway-service/Dockerfile create mode 100644 java-server/board-service/Dockerfile create mode 100644 java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/web/BoardWebConfiguration.java create mode 100644 java-server/board-view-service/Dockerfile create mode 100644 java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/web/BoardViewWebConfiguration.java delete mode 100644 java-server/docker/Dockerfile delete mode 100755 java-server/docker/_build.sh delete mode 100755 java-server/docker/build-images.sh delete mode 100644 java-server/docker/create-services.sh create mode 100644 java-server/task-service/Dockerfile create mode 100644 java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/web/TaskWebConfiguration.java create mode 100644 java-server/task-view-service/Dockerfile create mode 100644 java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/web/TaskViewWebConfiguration.java diff --git a/java-server/api-gateway-service/Dockerfile b/java-server/api-gateway-service/Dockerfile new file mode 100644 index 00000000..1d7bbb63 --- /dev/null +++ b/java-server/api-gateway-service/Dockerfile @@ -0,0 +1,4 @@ +FROM java:openjdk-8u91-jdk +CMD java -jar api-gateway-service.jar +EXPOSE 8081 +COPY build/libs/api-gateway-service.jar . \ No newline at end of file diff --git a/java-server/board-service/Dockerfile b/java-server/board-service/Dockerfile new file mode 100644 index 00000000..067217fb --- /dev/null +++ b/java-server/board-service/Dockerfile @@ -0,0 +1,4 @@ +FROM java:openjdk-8u91-jdk +CMD java -jar board-service.jar +EXPOSE 8081 +COPY build/libs/board-service.jar . \ No newline at end of file diff --git a/java-server/board-service/build.gradle b/java-server/board-service/build.gradle index 15fd0bda..0f8a56e5 100644 --- a/java-server/board-service/build.gradle +++ b/java-server/board-service/build.gradle @@ -6,6 +6,7 @@ apply plugin: 'spring-boot' dependencies { compile project(":common-board") compile project(":common-web") + compile project(":common-websocket") compile project(":common-swagger") compile project(":common-auth") @@ -14,5 +15,7 @@ dependencies { compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion" compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" - testCompile "junit:junit:4.11" + testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" + testCompile "io.eventuate.client.java:eventuate-client-java-test-util:$eventuateClientVersion" + testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" } diff --git a/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/web/BoardWebConfiguration.java b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/web/BoardWebConfiguration.java new file mode 100644 index 00000000..15cfdf12 --- /dev/null +++ b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/web/BoardWebConfiguration.java @@ -0,0 +1,12 @@ +package net.chrisrichardson.eventstore.examples.kanban.boardservice.web; + +import net.chrisrichardson.eventstore.examples.kanban.boardservice.backend.BoardBackendConfiguration; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +@Configuration +@Import(BoardBackendConfiguration.class) +@ComponentScan +public class BoardWebConfiguration { +} diff --git a/java-server/board-view-service/Dockerfile b/java-server/board-view-service/Dockerfile new file mode 100644 index 00000000..51da4f89 --- /dev/null +++ b/java-server/board-view-service/Dockerfile @@ -0,0 +1,4 @@ +FROM java:openjdk-8u91-jdk +CMD java -jar board-view-service.jar +EXPOSE 8083 +COPY build/libs/board-view-service.jar . \ No newline at end of file diff --git a/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java index f5a37fa5..8d0dec37 100755 --- a/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java @@ -13,8 +13,6 @@ @Configuration @EnableEventHandlers -@EnableAutoConfiguration -@ComponentScan @EnableMongoRepositories public class BoardViewBackendConfiguration { diff --git a/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/web/BoardViewWebConfiguration.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/web/BoardViewWebConfiguration.java new file mode 100644 index 00000000..6c78856e --- /dev/null +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/web/BoardViewWebConfiguration.java @@ -0,0 +1,12 @@ +package net.chrisrichardson.eventstore.examples.kanban.boardviewservice.web; + +import net.chrisrichardson.eventstore.examples.kanban.boardviewservice.backend.BoardViewBackendConfiguration; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +@Configuration +@Import(BoardViewBackendConfiguration.class) +@ComponentScan +public class BoardViewWebConfiguration { +} diff --git a/java-server/docker-compose-common.yml b/java-server/docker-compose-common.yml index ce25dec4..f3d1e5be 100755 --- a/java-server/docker-compose-common.yml +++ b/java-server/docker-compose-common.yml @@ -1,6 +1,5 @@ apigateway: - image: java:openjdk-8u91-jdk - command: java -jar /app/api-gateway-service.jar + build: ./api-gateway-service ports: - "8080:8080" environment: @@ -11,28 +10,24 @@ apigateway: boardcommandside: - image: java:openjdk-8u91-jdk - command: java -jar /app/board-command-side-service.jar + build: ./board-service ports: - "8081:8080" taskcommandside: - image: java:openjdk-8u91-jdk - command: java -jar /app/task-command-side-service.jar + build: ./task-service ports: - "8082:8080" boardqueryside: - image: java:openjdk-8u91-jdk - command: java -jar /app/board-query-side-service.jar + build: ./board-view-service ports: - "8083:8080" environment: SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban taskqueryside: - image: java:openjdk-8u91-jdk - command: java -jar /app/task-query-side-service.jar + build: ./task-view-service ports: - "8084:8080" environment: diff --git a/java-server/docker/Dockerfile b/java-server/docker/Dockerfile deleted file mode 100644 index 92fa48ee..00000000 --- a/java-server/docker/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM java:openjdk-8u91-jdk -MAINTAINER chris@chrisrichardson.net -EXPOSE 8080 -WORKDIR /app -CMD java -jar /app/*.jar -COPY *.jar . diff --git a/java-server/docker/_build.sh b/java-server/docker/_build.sh deleted file mode 100755 index 75899890..00000000 --- a/java-server/docker/_build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -echo $DIR - -cp ../libs/*.jar . - -cp $DIR/Dockerfile . - -docker build -t eventuate_kanban_${1?} . - diff --git a/java-server/docker/build-images.sh b/java-server/docker/build-images.sh deleted file mode 100755 index 8cf8180c..00000000 --- a/java-server/docker/build-images.sh +++ /dev/null @@ -1,18 +0,0 @@ -#! /bin/bash -e - -CURDIR=`pwd` - -for dir in api-gateway-service board-command-side-service task-command-side-service board-query-side-service \ - task-query-side-service standalone-service; do - -DOCKER_BUILD_DIR=$dir/build/docker - -mkdir -p ${DOCKER_BUILD_DIR?} - -cd ${DOCKER_BUILD_DIR?} - -../../../docker/_build.sh `echo $dir | sed -e 's/-/_/g'` - -cd ${CURDIR?} - -done diff --git a/java-server/docker/create-services.sh b/java-server/docker/create-services.sh deleted file mode 100644 index f5183eb1..00000000 --- a/java-server/docker/create-services.sh +++ /dev/null @@ -1,2 +0,0 @@ - -docker service create --name mongo mongo:3.0.4 \ No newline at end of file diff --git a/java-server/gradle.properties b/java-server/gradle.properties index c7244369..c5ed1e0a 100755 --- a/java-server/gradle.properties +++ b/java-server/gradle.properties @@ -6,5 +6,5 @@ eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release springBootVersion=1.3.5.RELEASE -eventuateClientVersion=0.10.0.RELEASE -eventuateLocalVersion=0.4.0.RELEASE \ No newline at end of file +eventuateClientVersion=0.12.0.RELEASE +eventuateLocalVersion=0.6.0.RELEASE \ No newline at end of file diff --git a/java-server/rest-api-integration-tests/build.gradle b/java-server/rest-api-integration-tests/build.gradle index 7b3c331c..98556bf0 100755 --- a/java-server/rest-api-integration-tests/build.gradle +++ b/java-server/rest-api-integration-tests/build.gradle @@ -1,9 +1,12 @@ apply plugin: 'java' dependencies { - testCompile project(":common-board") - testCompile project(":common-task") + testCompile project(":board-service") + testCompile project(":board-view-service") + testCompile project(":task-service") + testCompile project(":task-view-service") testCompile project(":test-utils") + testCompile project(":common-auth-controller") testCompile "junit:junit:4.11" diff --git a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java index 269050a1..5e4aca49 100755 --- a/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java +++ b/java-server/rest-api-integration-tests/src/test/java/net/chrisrichardson/eventstore/examples/kanban/integrationtests/RestAPITestConfiguration.java @@ -1,11 +1,16 @@ package net.chrisrichardson.eventstore.examples.kanban.integrationtests; import com.fasterxml.jackson.databind.ObjectMapper; -import io.eventuate.javaclient.spring.jdbc.EventuateJdbcEventStoreConfiguration; +import io.eventuate.javaclient.spring.jdbc.EmbeddedTestAggregateStoreConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.boardservice.web.BoardWebConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.boardviewservice.web.BoardViewWebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonwebsocket.WebsocketEventsTranslator; +import net.chrisrichardson.eventstore.examples.kanban.taskservice.web.TaskWebConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.taskviewservice.web.TaskViewWebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.testutil.BasicWebTestConfiguration; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -21,12 +26,12 @@ @Configuration @EnableWebSecurity -@Import({EventuateJdbcEventStoreConfiguration.class, +@Import({EmbeddedTestAggregateStoreConfiguration.class, BasicWebTestConfiguration.class, -/* BoardQuerySideConfiguration.class, - TaskQuerySideConfiguration.class, - BoardCommandSideConfiguration.class, - TaskCommandSideConfiguration.class*/}) + BoardWebConfiguration.class, + TaskViewWebConfiguration.class, + BoardViewWebConfiguration.class, + TaskWebConfiguration.class}) public class RestAPITestConfiguration { @Bean diff --git a/java-server/rest-api-integration-tests/src/test/resources/logback.xml b/java-server/rest-api-integration-tests/src/test/resources/logback.xml index 55a8ed13..d51f08dc 100755 --- a/java-server/rest-api-integration-tests/src/test/resources/logback.xml +++ b/java-server/rest-api-integration-tests/src/test/resources/logback.xml @@ -9,9 +9,13 @@ - + + + + + \ No newline at end of file diff --git a/java-server/task-service/Dockerfile b/java-server/task-service/Dockerfile new file mode 100644 index 00000000..5d1ada60 --- /dev/null +++ b/java-server/task-service/Dockerfile @@ -0,0 +1,4 @@ +FROM java:openjdk-8u91-jdk +CMD java -jar task-service.jar +EXPOSE 8082 +COPY build/libs/task-service.jar . \ No newline at end of file diff --git a/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/web/TaskWebConfiguration.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/web/TaskWebConfiguration.java new file mode 100644 index 00000000..bf4691e7 --- /dev/null +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/web/TaskWebConfiguration.java @@ -0,0 +1,12 @@ +package net.chrisrichardson.eventstore.examples.kanban.taskservice.web; + +import net.chrisrichardson.eventstore.examples.kanban.taskservice.backend.TaskBackendConfiguration; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +@Configuration +@Import(TaskBackendConfiguration.class) +@ComponentScan +public class TaskWebConfiguration { +} diff --git a/java-server/task-view-service/Dockerfile b/java-server/task-view-service/Dockerfile new file mode 100644 index 00000000..e708b421 --- /dev/null +++ b/java-server/task-view-service/Dockerfile @@ -0,0 +1,4 @@ +FROM java:openjdk-8u91-jdk +CMD java -jar task-view-service.jar +EXPOSE 8084 +COPY build/libs/task-view-service.jar . \ No newline at end of file diff --git a/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java index 3c8b64af..1768c493 100755 --- a/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java @@ -17,8 +17,6 @@ @Configuration -@EnableAutoConfiguration -@ComponentScan @EnableMongoRepositories @EnableEventHandlers public class TaskViewBackendConfiguration { diff --git a/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/web/TaskViewWebConfiguration.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/web/TaskViewWebConfiguration.java new file mode 100644 index 00000000..669a3ccd --- /dev/null +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/web/TaskViewWebConfiguration.java @@ -0,0 +1,12 @@ +package net.chrisrichardson.eventstore.examples.kanban.taskviewservice.web; + +import net.chrisrichardson.eventstore.examples.kanban.taskviewservice.backend.TaskViewBackendConfiguration; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +@Configuration +@Import(TaskViewBackendConfiguration.class) +@ComponentScan +public class TaskViewWebConfiguration { +} From 08eb9185a59ceaae0de3b6ba407b7eb56154633a Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Fri, 28 Oct 2016 23:57:23 +0300 Subject: [PATCH 22/26] services configuration fixes --- java-server/_build-and-test-all.sh | 2 ++ .../kanban/boardservice/BoardServiceMain.java | 4 ++-- .../boardviewservice/BoardViewServiceMain.java | 4 ++-- java-server/docker-compose-common.yml | 16 ++++++++-------- .../rest-api-integration-tests/build.gradle | 1 + .../kanban/taskservice/TaskServiceMain.java | 4 ++-- .../taskviewservice/TaskViewServiceMain.java | 4 ++-- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/java-server/_build-and-test-all.sh b/java-server/_build-and-test-all.sh index 65c8aa5c..5955b9e9 100755 --- a/java-server/_build-and-test-all.sh +++ b/java-server/_build-and-test-all.sh @@ -55,6 +55,8 @@ if [ -z "$EVENTUATE_LOCAL" ] && [ -z "$EVENTUATE_API_KEY_ID" -o -z "$EVENTUATE_A exit -1 fi +${DOCKER_COMPOSE?} build + ${DOCKER_COMPOSE?} up -d ./wait-for-services.sh $DOCKER_HOST_IP 8080 8081 8082 8083 8084 diff --git a/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/BoardServiceMain.java b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/BoardServiceMain.java index e2574777..13aeb6a0 100755 --- a/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/BoardServiceMain.java +++ b/java-server/board-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardservice/BoardServiceMain.java @@ -1,7 +1,7 @@ package net.chrisrichardson.eventstore.examples.kanban.boardservice; import io.eventuate.javaclient.driver.EventuateDriverConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.boardservice.backend.BoardBackendConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.boardservice.web.BoardWebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Import; @Configuration -@Import({BoardBackendConfiguration.class, +@Import({BoardWebConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, diff --git a/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/BoardViewServiceMain.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/BoardViewServiceMain.java index 4426f081..6c4f9c31 100755 --- a/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/BoardViewServiceMain.java +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/BoardViewServiceMain.java @@ -1,7 +1,7 @@ package net.chrisrichardson.eventstore.examples.kanban.boardviewservice; import io.eventuate.javaclient.driver.EventuateDriverConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.boardviewservice.backend.BoardViewBackendConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.boardviewservice.web.BoardViewWebConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Import; @Configuration -@Import({BoardViewBackendConfiguration.class, +@Import({BoardViewWebConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, diff --git a/java-server/docker-compose-common.yml b/java-server/docker-compose-common.yml index f3d1e5be..7933add8 100755 --- a/java-server/docker-compose-common.yml +++ b/java-server/docker-compose-common.yml @@ -3,33 +3,33 @@ apigateway: ports: - "8080:8080" environment: - BOARD_COMMANDSIDE_SERVICE_URL: http://boardcommandside:8080 - BOARD_QUERYSIDE_SERVICE_URL: http://boardqueryside:8080 - TASK_COMMANDSIDE_SERVICE_URL: http://taskcommandside:8080 - TASK_QUERYSIDE_SERVICE_URL: http://taskqueryside:8080 + BOARD_COMMANDSIDE_SERVICE_URL: http://boardcommandside:8081 + BOARD_QUERYSIDE_SERVICE_URL: http://boardqueryside:8083 + TASK_COMMANDSIDE_SERVICE_URL: http://taskcommandside:8082 + TASK_QUERYSIDE_SERVICE_URL: http://taskqueryside:8084 boardcommandside: build: ./board-service ports: - - "8081:8080" + - "8081:8081" taskcommandside: build: ./task-service ports: - - "8082:8080" + - "8082:8082" boardqueryside: build: ./board-view-service ports: - - "8083:8080" + - "8083:8083" environment: SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban taskqueryside: build: ./task-view-service ports: - - "8084:8080" + - "8084:8084" environment: SPRING_DATA_MONGODB_URI: mongodb://mongodb/kanban diff --git a/java-server/rest-api-integration-tests/build.gradle b/java-server/rest-api-integration-tests/build.gradle index 98556bf0..6e9a3aa1 100755 --- a/java-server/rest-api-integration-tests/build.gradle +++ b/java-server/rest-api-integration-tests/build.gradle @@ -11,5 +11,6 @@ dependencies { testCompile "junit:junit:4.11" testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion" + testCompile "io.eventuate.client.java:eventuate-client-java-test-util:$eventuateClientVersion" testCompile "io.eventuate.client.java:eventuate-client-java-jdbc:$eventuateClientVersion" } diff --git a/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/TaskServiceMain.java b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/TaskServiceMain.java index 3e0070dd..243c24d6 100755 --- a/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/TaskServiceMain.java +++ b/java-server/task-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskservice/TaskServiceMain.java @@ -4,14 +4,14 @@ import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.taskservice.backend.TaskBackendConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.taskservice.web.TaskWebConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({TaskBackendConfiguration.class, +@Import({TaskWebConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, diff --git a/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/TaskViewServiceMain.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/TaskViewServiceMain.java index c5802da9..b85482d8 100755 --- a/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/TaskViewServiceMain.java +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/TaskViewServiceMain.java @@ -4,14 +4,14 @@ import net.chrisrichardson.eventstore.examples.kanban.commonauth.AuthConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonswagger.CommonSwaggerConfiguration; import net.chrisrichardson.eventstore.examples.kanban.commonweb.WebConfiguration; -import net.chrisrichardson.eventstore.examples.kanban.taskviewservice.backend.TaskViewBackendConfiguration; +import net.chrisrichardson.eventstore.examples.kanban.taskviewservice.web.TaskViewWebConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration -@Import({TaskViewBackendConfiguration.class, +@Import({TaskViewWebConfiguration.class, EventuateDriverConfiguration.class, WebConfiguration.class, AuthConfiguration.class, From 1dc98117fb341ce8939666c5446809380b85c5a5 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Sun, 30 Oct 2016 00:06:00 +0300 Subject: [PATCH 23/26] fixed aggregate names in the event classes --- java-server/board-view-service/build.gradle | 2 +- .../BoardViewBackendConfiguration.java | 27 +++++++++---------- .../kanban/common/board/event/BoardEvent.java | 2 +- .../kanban/common/task/event/TaskEvent.java | 2 +- .../backend/TaskViewBackendConfiguration.java | 2 +- .../testutil/BasicWebTestConfiguration.java | 5 +++- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/java-server/board-view-service/build.gradle b/java-server/board-view-service/build.gradle index 890f705d..38c20c70 100644 --- a/java-server/board-view-service/build.gradle +++ b/java-server/board-view-service/build.gradle @@ -2,7 +2,7 @@ apply plugin: VerifyMongoDBConfigurationPlugin apply plugin: VerifyEventStoreEnvironmentPlugin apply plugin: EventuateDependencyPlugin -apply plugin: 'java' +apply plugin: 'spring-boot' dependencies { compile project(":common-board") diff --git a/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java index 8d0dec37..4660c84a 100755 --- a/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java +++ b/java-server/board-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/boardviewservice/backend/BoardViewBackendConfiguration.java @@ -2,7 +2,6 @@ import io.eventuate.javaclient.spring.EnableEventHandlers; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.web.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -16,19 +15,19 @@ @EnableMongoRepositories public class BoardViewBackendConfiguration { - @Bean - public BoardViewEventSubscriber boardQueryWorkflow(BoardUpdateService boardInfoUpdateService) { - return new BoardViewEventSubscriber(boardInfoUpdateService); - } + @Bean + public BoardViewEventSubscriber boardViewEventSubscriber(BoardUpdateService boardInfoUpdateService) { + return new BoardViewEventSubscriber(boardInfoUpdateService); + } - @Bean - public BoardUpdateService boardInfoUpdateService(BoardRepository boardRepository) { - return new BoardUpdateService(boardRepository); - } + @Bean + public BoardUpdateService boardInfoUpdateService(BoardRepository boardRepository) { + return new BoardUpdateService(boardRepository); + } - @Bean - public HttpMessageConverters customConverters() { - HttpMessageConverter additional = new MappingJackson2HttpMessageConverter(); - return new HttpMessageConverters(additional); - } + @Bean + public HttpMessageConverters customConverters() { + HttpMessageConverter additional = new MappingJackson2HttpMessageConverter(); + return new HttpMessageConverters(additional); + } } diff --git a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardEvent.java b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardEvent.java index 3a18fa3b..894064b7 100755 --- a/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardEvent.java +++ b/java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/event/BoardEvent.java @@ -4,6 +4,6 @@ import io.eventuate.Event; import io.eventuate.EventEntity; -@EventEntity(entity = "net.chrisrichardson.eventstore.examples.kanban.commandside.board.BoardAggregate") +@EventEntity(entity = "net.chrisrichardson.eventstore.examples.kanban.boardservice.backend.BoardAggregate") public class BoardEvent implements Event { } diff --git a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskEvent.java b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskEvent.java index 51ac3497..f78f8fdd 100755 --- a/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskEvent.java +++ b/java-server/common-task/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/task/event/TaskEvent.java @@ -4,6 +4,6 @@ import io.eventuate.Event; import io.eventuate.EventEntity; -@EventEntity(entity="net.chrisrichardson.eventstore.examples.kanban.commandside.task.TaskAggregate") +@EventEntity(entity="net.chrisrichardson.eventstore.examples.kanban.taskservice.backend.TaskAggregate") public abstract class TaskEvent implements Event { } diff --git a/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java index 1768c493..975ab22b 100755 --- a/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java +++ b/java-server/task-view-service/src/main/java/net/chrisrichardson/eventstore/examples/kanban/taskviewservice/backend/TaskViewBackendConfiguration.java @@ -23,7 +23,7 @@ public class TaskViewBackendConfiguration { @Bean - public TaskViewEventSubscriber taskQueryWorkflow(TaskUpdateService taskUpdateService) { + public TaskViewEventSubscriber taskViewEventSubscriber(TaskUpdateService taskUpdateService) { return new TaskViewEventSubscriber(taskUpdateService); } diff --git a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BasicWebTestConfiguration.java b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BasicWebTestConfiguration.java index 7269f450..cf716019 100755 --- a/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BasicWebTestConfiguration.java +++ b/java-server/test-utils/src/main/java/net/chrisrichardson/eventstore/examples/kanban/testutil/BasicWebTestConfiguration.java @@ -23,7 +23,10 @@ @Configuration @EnableWebSecurity -@Import({WebConfiguration.class, AuthConfiguration.class, WebSocketConfig.class, WebSocketSecurityConfig.class}) +@Import({WebConfiguration.class, + AuthConfiguration.class, + WebSocketConfig.class, + WebSocketSecurityConfig.class}) public class BasicWebTestConfiguration { @Bean From 4a45cf9a5b015b78696f524a33927f5f5c58a640 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Sun, 30 Oct 2016 00:48:13 +0300 Subject: [PATCH 24/26] fixed task-view-service properties --- .../docker-compose-eventuate-local.yml | 10 --------- java-server/docker-compose.yml | 10 --------- .../src/main/resources/application.properties | 2 ++ .../src/main/resources/logback.xml | 21 +++++++++++++++++++ 4 files changed, 23 insertions(+), 20 deletions(-) create mode 100644 java-server/task-view-service/src/main/resources/application.properties create mode 100755 java-server/task-view-service/src/main/resources/logback.xml diff --git a/java-server/docker-compose-eventuate-local.yml b/java-server/docker-compose-eventuate-local.yml index fcb63b6b..d1e6b385 100644 --- a/java-server/docker-compose-eventuate-local.yml +++ b/java-server/docker-compose-eventuate-local.yml @@ -54,8 +54,6 @@ apigateway: extends: file: docker-compose-common.yml service: apigateway - volumes: - - ../api-gateway-service/build/libs:/app links: - boardcommandside - taskcommandside @@ -79,8 +77,6 @@ boardcommandside: extends: file: docker-compose-common.yml service: boardcommandside - volumes: - - ../board-command-side-service/build/libs:/app links: - mysql - kafka @@ -99,8 +95,6 @@ taskcommandside: extends: file: docker-compose-common.yml service: taskcommandside - volumes: - - ../task-command-side-service/build/libs:/app links: - mysql - kafka @@ -119,8 +113,6 @@ boardqueryside: extends: file: docker-compose-common.yml service: boardqueryside - volumes: - - ../board-query-side-service/build/libs:/app links: - mongodb - mysql @@ -140,8 +132,6 @@ taskqueryside: extends: file: docker-compose-common.yml service: taskqueryside - volumes: - - ../task-query-side-service/build/libs:/app links: - mongodb - mysql diff --git a/java-server/docker-compose.yml b/java-server/docker-compose.yml index bf06a02c..c82e453c 100755 --- a/java-server/docker-compose.yml +++ b/java-server/docker-compose.yml @@ -2,8 +2,6 @@ apigateway: extends: file: docker-compose-common.yml service: apigateway - volumes: - - ../api-gateway-service/build/libs:/app links: - boardcommandside - taskcommandside @@ -17,8 +15,6 @@ boardcommandside: extends: file: docker-compose-common.yml service: boardcommandside - volumes: - - ../board-command-side-service/build/libs:/app environment: EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} @@ -27,8 +23,6 @@ taskcommandside: extends: file: docker-compose-common.yml service: taskcommandside - volumes: - - ../task-command-side-service/build/libs:/app environment: EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID} EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET} @@ -37,8 +31,6 @@ boardqueryside: extends: file: docker-compose-common.yml service: boardqueryside - volumes: - - ../board-query-side-service/build/libs:/app links: - mongodb environment: @@ -49,8 +41,6 @@ taskqueryside: extends: file: docker-compose-common.yml service: taskqueryside - volumes: - - ../task-query-side-service/build/libs:/app links: - mongodb environment: diff --git a/java-server/task-view-service/src/main/resources/application.properties b/java-server/task-view-service/src/main/resources/application.properties new file mode 100644 index 00000000..aaa3c53c --- /dev/null +++ b/java-server/task-view-service/src/main/resources/application.properties @@ -0,0 +1,2 @@ +spring.application.name=task-view-service +server.port=8084 \ No newline at end of file diff --git a/java-server/task-view-service/src/main/resources/logback.xml b/java-server/task-view-service/src/main/resources/logback.xml new file mode 100755 index 00000000..84cbb835 --- /dev/null +++ b/java-server/task-view-service/src/main/resources/logback.xml @@ -0,0 +1,21 @@ + + + + + + + + %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n + + + + + + + + + + + + + \ No newline at end of file From b573bf1af23bebdd9c3c0cc58ebd4b7baf60e8fe Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Fri, 23 Dec 2016 20:05:32 +0300 Subject: [PATCH 25/26] removed standalone-service module, updated eventuate-local version --- java-server/gradle.properties | 2 +- java-server/settings.gradle | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/java-server/gradle.properties b/java-server/gradle.properties index 078e09e4..7228dcca 100755 --- a/java-server/gradle.properties +++ b/java-server/gradle.properties @@ -6,4 +6,4 @@ eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release springBootVersion=1.3.5.RELEASE eventuateClientVersion=0.12.0.RELEASE -eventuateLocalVersion=0.6.0.RELEASE \ No newline at end of file +eventuateLocalVersion=0.7.0.RELEASE \ No newline at end of file diff --git a/java-server/settings.gradle b/java-server/settings.gradle index 57cf7eb1..f9994a6b 100755 --- a/java-server/settings.gradle +++ b/java-server/settings.gradle @@ -11,7 +11,6 @@ include 'board-view-service' include 'task-service' include 'task-view-service' -include 'standalone-service' include 'rest-api-integration-tests' include 'api-gateway-service' include 'common-auth' From 5f3cce60af2a6117c0e7addcc965d4cf80da3d53 Mon Sep 17 00:00:00 2001 From: dartpopikyardo Date: Fri, 30 Dec 2016 16:39:38 +0300 Subject: [PATCH 26/26] updated eventuate-local version --- java-server/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-server/gradle.properties b/java-server/gradle.properties index 7228dcca..078e09e4 100755 --- a/java-server/gradle.properties +++ b/java-server/gradle.properties @@ -6,4 +6,4 @@ eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release springBootVersion=1.3.5.RELEASE eventuateClientVersion=0.12.0.RELEASE -eventuateLocalVersion=0.7.0.RELEASE \ No newline at end of file +eventuateLocalVersion=0.6.0.RELEASE \ No newline at end of file