Merge commit '2c97630aa6100ac8b507b71c4a3468540996f136' into wip-customer
* commit '2c97630aa6100ac8b507b71c4a3468540996f136': Improved Eventuate Local support fixed getDate() private-event-sourcing-examples-26 solved comments on previous commit: - changed getting Content-Type header for GatewayController - updated transaction state change logic - renamed "date" field in AccountInfo Fixed typo Fixed typo Added Swagger to monolithic deployment, Added mongodb-cli.sh Fixed typo Use specific Java 8 Docker image
This commit is contained in:
18
README.md
18
README.md
@@ -1,7 +1,7 @@
|
|||||||
#Event-Sourcing+CQRS example application
|
#Event-Sourcing+CQRS example application
|
||||||
|
|
||||||
This example application is the money transfer application described in my talk [Building and deploying microservices with event sourcing, CQRS and Docker](http://plainoldobjects.com/presentations/building-and-deploying-microservices-with-event-sourcing-cqrs-and-docker/).
|
This example application is the money transfer application described in my talk [Building and deploying microservices with event sourcing, CQRS and Docker](http://plainoldobjects.com/presentations/building-and-deploying-microservices-with-event-sourcing-cqrs-and-docker/).
|
||||||
This talk describe a way of architecting highly scalable and available applications that is based on microservices, polyglot persistence,
|
This talk describes a way of architecting highly scalable and available applications that is based on microservices, polyglot persistence,
|
||||||
event sourcing (ES) and command query responsibility segregation (CQRS).
|
event sourcing (ES) and command query responsibility segregation (CQRS).
|
||||||
Applications consist of loosely coupled components that communicate using events.
|
Applications consist of loosely coupled components that communicate using events.
|
||||||
These components can be deployed either as separate services or packaged as a monolithic application for simplified development and testing.
|
These components can be deployed either as separate services or packaged as a monolithic application for simplified development and testing.
|
||||||
@@ -94,9 +94,12 @@ First, you need to tell the query side code how to connect to MongoDB:
|
|||||||
```
|
```
|
||||||
|
|
||||||
[Docker Compose](https://docs.docker.com/compose/) is a great way to run MongoDB.
|
[Docker Compose](https://docs.docker.com/compose/) is a great way to run MongoDB.
|
||||||
You can run the `docker-compose up -d mongodb` to run MongoDB.
|
You can run the `docker-compose up -d mongodb` to run MongoDB and then set `SPRING_DATA_MONGODB_URI` as follows:
|
||||||
|
```
|
||||||
|
export SPRING_DATA_MONGODB_URI=mongodb://$(docker-machine ip default)/yourdb
|
||||||
|
```
|
||||||
|
|
||||||
Second, some of the tests in accounts-command-side-service, transactions-command-side-service, accounts-query-side-service and e2e-test need you need to set some environment variables that tell them how to connect to the Event Store server.
|
Second, some of the tests in accounts-command-side-service, transactions-command-side-service, accounts-query-side-service and e2e-test require you to set some environment variables that tell them how to connect to the Event Store server.
|
||||||
But don't worry.
|
But don't worry.
|
||||||
The build is configured to ignore failures for those projects.
|
The build is configured to ignore failures for those projects.
|
||||||
|
|
||||||
@@ -117,6 +120,15 @@ Simply use this command:
|
|||||||
java -jar monolithic-service/build/libs/monolithic-service.jar
|
java -jar monolithic-service/build/libs/monolithic-service.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This will start the service running on port 8080 (you can change using the --server.port=9999 option).
|
||||||
|
|
||||||
|
Once the service has started you can open the Swagger UI: http://localhost:8080/swagger-ui.html.
|
||||||
|
You can then:
|
||||||
|
|
||||||
|
1. Create two accounts (save the account ids)
|
||||||
|
2. Create a money transfer
|
||||||
|
3. View the updated account balances
|
||||||
|
|
||||||
## Running the microservices
|
## Running the microservices
|
||||||
|
|
||||||
The other option is to run the services separately.
|
The other option is to run the services separately.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if [ "$1" = "--no-rm" ] ; then
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${DOCKER_COMPOSE?} up -d mongodb
|
${DOCKER_COMPOSE?} up -d mongodb $EXTRA_INFRASTRUCTURE_SERVICES
|
||||||
|
|
||||||
if [ -z "$DOCKER_HOST_IP" ] ; then
|
if [ -z "$DOCKER_HOST_IP" ] ; then
|
||||||
if which docker-machine >/dev/null; then
|
if which docker-machine >/dev/null; then
|
||||||
|
|||||||
@@ -7,19 +7,19 @@ This application consists of three microservices:
|
|||||||
* Account Service - the command side business logic for Accounts
|
* Account Service - the command side business logic for Accounts
|
||||||
* Money Transfer Service - the command side business logic for Money Transfers
|
* Money Transfer Service - the command side business logic for Money Transfers
|
||||||
* Query service - query side implementation of a MongoDB-based, denormalized view of Accounts and MoneyTransfers
|
* Query service - query side implementation of a MongoDB-based, denormalized view of Accounts and MoneyTransfers
|
||||||
|
|
||||||
The Account Service consists of the following modules:
|
The Account Service consists of the following modules:
|
||||||
|
|
||||||
* accounts-command-side-backend - the Account aggregate
|
* accounts-command-side-backend - the Account aggregate
|
||||||
* accounts-command-side-web - a REST API for creating and retrieving Accounts
|
* accounts-command-side-web - a REST API for creating and retrieving Accounts
|
||||||
* accounts-command-side-service - a standalone microservice
|
* accounts-command-side-service - a standalone microservice
|
||||||
|
|
||||||
The Money Transfer Service consists of the following modules:
|
The Money Transfer Service consists of the following modules:
|
||||||
|
|
||||||
* transactions-command-side-backend - the MoneyTransfer aggregate
|
* transactions-command-side-backend - the MoneyTransfer aggregate
|
||||||
* transactions-command-side-web - a REST API for creating and retrieving Money Transfers
|
* transactions-command-side-web - a REST API for creating and retrieving Money Transfers
|
||||||
* transactions-command-side-service - a standalone microservice
|
* transactions-command-side-service - a standalone microservice
|
||||||
|
|
||||||
The Query Service consists the following modules:
|
The Query Service consists the following modules:
|
||||||
|
|
||||||
* accounts-query-side-backend - MongoDB-based, denormalized view of Accounts and MoneyTransfers
|
* accounts-query-side-backend - MongoDB-based, denormalized view of Accounts and MoneyTransfers
|
||||||
@@ -28,10 +28,8 @@ The Query Service consists the following modules:
|
|||||||
|
|
||||||
# Deploying the application
|
# Deploying the application
|
||||||
|
|
||||||
These services can be deployed either as either separate standalone services using the Event Store server, or they can be deployed as a monolithic application for simpified integration testing.
|
These services can be deployed either as either separate standalone services using the Event Store server, or they can be deployed as a monolithic application for simplified integration testing.
|
||||||
|
|
||||||
The three services can also be packaged as a single monolithic web application in order to be used with the embedded Event Store:
|
The three services can also be packaged as a single monolithic web application in order to be used with the embedded Event Store:
|
||||||
|
|
||||||
* monolithic-service - all-in-one, monolithic packaging of the application
|
* monolithic-service - all-in-one, monolithic packaging of the application
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.accounts;
|
package net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.accounts;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountChangeInfo;
|
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountChangeInfo;
|
||||||
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountTransactionInfo;
|
import net.chrisrichardson.eventstore.javaexamples.banking.common.accounts.AccountTransactionInfo;
|
||||||
import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.TransferState;
|
import net.chrisrichardson.eventstore.javaexamples.banking.common.transactions.TransferState;
|
||||||
@@ -19,7 +20,8 @@ public class AccountInfo {
|
|||||||
private List<AccountChangeInfo> changes;
|
private List<AccountChangeInfo> changes;
|
||||||
private Map<String, AccountTransactionInfo> transactions;
|
private Map<String, AccountTransactionInfo> transactions;
|
||||||
private String version;
|
private String version;
|
||||||
private Date date;
|
@JsonProperty("date")
|
||||||
|
private Date creationDate;
|
||||||
|
|
||||||
private AccountInfo() {
|
private AccountInfo() {
|
||||||
}
|
}
|
||||||
@@ -28,7 +30,7 @@ public class AccountInfo {
|
|||||||
this(id, customerId, title, description, balance, changes, transactions, version, new Date());
|
this(id, customerId, title, description, balance, changes, transactions, version, new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccountInfo(String id, String customerId, String title, String description, long balance, List<AccountChangeInfo> changes, Map<String, AccountTransactionInfo> transactions, String version, Date date) {
|
public AccountInfo(String id, String customerId, String title, String description, long balance, List<AccountChangeInfo> changes, Map<String, AccountTransactionInfo> transactions, String version, Date creationDate) {
|
||||||
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.customerId = customerId;
|
this.customerId = customerId;
|
||||||
@@ -38,7 +40,7 @@ public class AccountInfo {
|
|||||||
this.changes = changes;
|
this.changes = changes;
|
||||||
this.transactions = transactions;
|
this.transactions = transactions;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.date = date;
|
this.creationDate = creationDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
@@ -73,7 +75,7 @@ public class AccountInfo {
|
|||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getDate() {
|
public Date getCreationDate() {
|
||||||
return date;
|
return creationDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class AccountInfoUpdateService {
|
|||||||
.set("description", description)
|
.set("description", description)
|
||||||
.set("balance", toIntegerRepr(initialBalance))
|
.set("balance", toIntegerRepr(initialBalance))
|
||||||
.push("changes", ci)
|
.push("changes", ci)
|
||||||
.set("date", new Date())
|
.set("date", getFromEventId(version))
|
||||||
.set("version", version),
|
.set("version", version),
|
||||||
AccountInfo.class);
|
AccountInfo.class);
|
||||||
logger.info("Saved in mongo");
|
logger.info("Saved in mongo");
|
||||||
@@ -55,12 +55,10 @@ public class AccountInfoUpdateService {
|
|||||||
|
|
||||||
|
|
||||||
public void addTransaction(String accountId, AccountTransactionInfo ti) {
|
public void addTransaction(String accountId, AccountTransactionInfo ti) {
|
||||||
System.out.println("Start addTransaction for: "+ti.toString());
|
|
||||||
mongoTemplate.upsert(new Query(where("id").is(accountId)),
|
mongoTemplate.upsert(new Query(where("id").is(accountId)),
|
||||||
new Update().
|
new Update().
|
||||||
set("transactions." + ti.getTransactionId(), ti),
|
set("transactions." + ti.getTransactionId(), ti),
|
||||||
AccountInfo.class);
|
AccountInfo.class);
|
||||||
System.out.println("End addTransaction for: "+ti.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -74,11 +72,17 @@ public class AccountInfoUpdateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateTransactionStatus(String accountId, String transactionId, TransferState status) {
|
public void updateTransactionStatus(String accountId, String transactionId, TransferState status) {
|
||||||
System.out.println("Start updateTransactionStatus "+accountId +" "+transactionId+" "+status);
|
|
||||||
mongoTemplate.upsert(new Query(where("id").is(accountId)),
|
mongoTemplate.upsert(new Query(where("id").is(accountId)),
|
||||||
new Update().
|
new Update().
|
||||||
set("transactions." + transactionId + ".status", status),
|
set("transactions." + transactionId + ".status", status),
|
||||||
AccountInfo.class);
|
AccountInfo.class);
|
||||||
System.out.println("End updateTransactionStatus "+accountId +" "+transactionId+" "+status);
|
}
|
||||||
|
|
||||||
|
private Date getFromEventId(String eventId) {
|
||||||
|
String[] s = eventId.split("-");
|
||||||
|
if (s.length != 2) {
|
||||||
|
return new Date();
|
||||||
|
}
|
||||||
|
return new Date(Long.parseUnsignedLong(s[0], 16));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import static net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.accounts.MoneyUtil.toIntegerRepr;
|
import static net.chrisrichardson.eventstore.javaexamples.banking.backend.queryside.accounts.MoneyUtil.toIntegerRepr;
|
||||||
|
|
||||||
@@ -40,6 +41,7 @@ public class AccountQueryWorkflow {
|
|||||||
String customerId = event.getCustomerId();
|
String customerId = event.getCustomerId();
|
||||||
String title = event.getTitle();
|
String title = event.getTitle();
|
||||||
String description = event.getDescription();
|
String description = event.getDescription();
|
||||||
|
|
||||||
accountInfoUpdateService.create(id, customerId, title, initialBalance, description, eventId);
|
accountInfoUpdateService.create(id, customerId, title, initialBalance, description, eventId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +70,6 @@ public class AccountQueryWorkflow {
|
|||||||
String accountId = de.getEntityId();
|
String accountId = de.getEntityId();
|
||||||
String transactionId = de.getEvent().getTransactionId();
|
String transactionId = de.getEvent().getTransactionId();
|
||||||
|
|
||||||
accountInfoUpdateService.updateTransactionStatus(accountId, transactionId, TransferState.DEBITED);
|
|
||||||
saveChange(de, -1);
|
saveChange(de, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,16 +78,37 @@ public class AccountQueryWorkflow {
|
|||||||
String accountId = de.getEntityId();
|
String accountId = de.getEntityId();
|
||||||
String transactionId = de.getEvent().getTransactionId();
|
String transactionId = de.getEvent().getTransactionId();
|
||||||
|
|
||||||
accountInfoUpdateService.updateTransactionStatus(accountId, transactionId, TransferState.COMPLETED);
|
|
||||||
saveChange(de, +1);
|
saveChange(de, +1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandlerMethod
|
@EventHandlerMethod
|
||||||
public void recordFailed(DispatchedEvent<AccountDebitFailedDueToInsufficientFundsEvent> de) {
|
public void updateDebitTransactionState(DispatchedEvent<DebitRecordedEvent> de) {
|
||||||
String accountId = de.getEntityId();
|
String transactionId = de.getEntityId();
|
||||||
String transactionId = de.getEvent().getTransactionId();
|
String fromAccountId = de.getEvent().getDetails().getFromAccountId();
|
||||||
|
String toAccountId = de.getEvent().getDetails().getToAccountId();
|
||||||
|
|
||||||
accountInfoUpdateService.updateTransactionStatus(accountId, transactionId, TransferState.FAILED_DUE_TO_INSUFFICIENT_FUNDS);
|
accountInfoUpdateService.updateTransactionStatus(fromAccountId, transactionId, TransferState.DEBITED);
|
||||||
|
accountInfoUpdateService.updateTransactionStatus(toAccountId, transactionId, TransferState.DEBITED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandlerMethod
|
||||||
|
public void updateCreditTransactionState(DispatchedEvent<CreditRecordedEvent> de) {
|
||||||
|
String transactionId = de.getEntityId();
|
||||||
|
String fromAccountId = de.getEvent().getDetails().getFromAccountId();
|
||||||
|
String toAccountId = de.getEvent().getDetails().getToAccountId();
|
||||||
|
|
||||||
|
accountInfoUpdateService.updateTransactionStatus(fromAccountId, transactionId, TransferState.COMPLETED);
|
||||||
|
accountInfoUpdateService.updateTransactionStatus(toAccountId, transactionId, TransferState.COMPLETED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandlerMethod
|
||||||
|
public void recordFailed(DispatchedEvent<FailedDebitRecordedEvent> de) {
|
||||||
|
String transactionId = de.getEntityId();
|
||||||
|
String fromAccountId = de.getEvent().getDetails().getFromAccountId();
|
||||||
|
String toAccountId = de.getEvent().getDetails().getToAccountId();
|
||||||
|
|
||||||
|
accountInfoUpdateService.updateTransactionStatus(fromAccountId, transactionId, TransferState.FAILED_DUE_TO_INSUFFICIENT_FUNDS);
|
||||||
|
accountInfoUpdateService.updateTransactionStatus(toAccountId, transactionId, TransferState.FAILED_DUE_TO_INSUFFICIENT_FUNDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends AccountChangedEvent> void saveChange(DispatchedEvent<T> de, int delta) {
|
public <T extends AccountChangedEvent> void saveChange(DispatchedEvent<T> de, int delta) {
|
||||||
@@ -101,5 +123,4 @@ public class AccountQueryWorkflow {
|
|||||||
|
|
||||||
accountInfoUpdateService.updateBalance(accountId, changeId, balanceDelta, ci);
|
accountInfoUpdateService.updateBalance(accountId, changeId, balanceDelta, ci);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class AccountQueryController {
|
|||||||
public ResponseEntity<AccountHistoryResponse> getTransactionsHistory(@PathVariable String accountId) {
|
public ResponseEntity<AccountHistoryResponse> getTransactionsHistory(@PathVariable String accountId) {
|
||||||
AccountInfo accountInfo = accountInfoQueryService.findByAccountId(accountId);
|
AccountInfo accountInfo = accountInfoQueryService.findByAccountId(accountId);
|
||||||
List<AccountHistoryEntry> historyEntries = new ArrayList<>();
|
List<AccountHistoryEntry> historyEntries = new ArrayList<>();
|
||||||
historyEntries.add(new AccountOpenInfo(accountInfo.getDate(), AccountHistoryEntry.EntryType.account, accountInfo.getChanges().get(0).getAmount()));
|
historyEntries.add(new AccountOpenInfo(accountInfo.getCreationDate(), AccountHistoryEntry.EntryType.account, accountInfo.getChanges().get(0).getAmount()));
|
||||||
accountInfo.getTransactions().forEach(historyEntries::add);
|
accountInfo.getTransactions().forEach(historyEntries::add);
|
||||||
|
|
||||||
return ResponseEntity.ok().body(new AccountHistoryResponse(historyEntries));
|
return ResponseEntity.ok().body(new AccountHistoryResponse(historyEntries));
|
||||||
|
|||||||
@@ -64,12 +64,12 @@ public class GatewayController {
|
|||||||
logger.info("request: {}", proxiedRequest);
|
logger.info("request: {}", proxiedRequest);
|
||||||
HttpResponse proxiedResponse = httpClient.execute(proxiedRequest);
|
HttpResponse proxiedResponse = httpClient.execute(proxiedRequest);
|
||||||
logger.info("Response {}", proxiedResponse.getStatusLine().getStatusCode());
|
logger.info("Response {}", proxiedResponse.getStatusLine().getStatusCode());
|
||||||
return new ResponseEntity<>(read(proxiedResponse.getEntity().getContent()), processHeaders(proxiedResponse.getAllHeaders()), HttpStatus.valueOf(proxiedResponse.getStatusLine().getStatusCode()));
|
return new ResponseEntity<>(read(proxiedResponse.getEntity().getContent()), processHeaders(proxiedResponse.getFirstHeader("Content-Type")), HttpStatus.valueOf(proxiedResponse.getStatusLine().getStatusCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private HttpHeaders processHeaders(Header[] headers) {
|
private HttpHeaders processHeaders(Header h) {
|
||||||
HttpHeaders result = new HttpHeaders();
|
HttpHeaders result = new HttpHeaders();
|
||||||
Stream.of(headers).filter(h -> h.getName().equalsIgnoreCase("Content-Type")).forEach( h -> result.set(h.getName(), h.getValue()));
|
result.set(h.getName(), h.getValue());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
java-spring/build-and-test-all-eventuate-local.sh
Executable file
4
java-spring/build-and-test-all-eventuate-local.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
export EXTRA_INFRASTRUCTURE_SERVICES=cdcservice
|
||||||
|
../_build-and-test-all.sh -f docker-compose-eventuate-local.yml -P eventuateLocal=1 $*
|
||||||
48
java-spring/docker-compose-common.yml
Normal file
48
java-spring/docker-compose-common.yml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
apigateway:
|
||||||
|
image: java:openjdk-8u91-jdk
|
||||||
|
command: java -jar /app/api-gateway-service.jar --accounts.commandside.service.host=accountscommandside --transfers.commandside.service.host=transactionscommandside --accounts.queryside.service.host=accountsqueryside --customers.commandside.service.host=customerscommandside --customers.queryside.service.host=customersqueryside
|
||||||
|
environment:
|
||||||
|
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
|
||||||
|
accountscommandside:
|
||||||
|
image: java:openjdk-8u91-jdk
|
||||||
|
command: java -jar /app/accounts-command-side-service.jar
|
||||||
|
ports:
|
||||||
|
- "8085:8080"
|
||||||
|
|
||||||
|
transactionscommandside:
|
||||||
|
image: java:openjdk-8u91-jdk
|
||||||
|
command: java -jar /app/transactions-command-side-service.jar
|
||||||
|
ports:
|
||||||
|
- "8082:8080"
|
||||||
|
|
||||||
|
accountsqueryside:
|
||||||
|
image: java:openjdk-8u91-jdk
|
||||||
|
command: java -jar /app/accounts-query-side-service.jar
|
||||||
|
environment:
|
||||||
|
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
||||||
|
ports:
|
||||||
|
- "8081:8080"
|
||||||
|
|
||||||
|
customerscommandside:
|
||||||
|
image: java:openjdk-8u91-jdk
|
||||||
|
command: java -jar /app/customers-command-side-service.jar
|
||||||
|
ports:
|
||||||
|
- "8083:8080"
|
||||||
|
|
||||||
|
customersqueryside:
|
||||||
|
image: java:openjdk-8u91-jdk
|
||||||
|
command: java -jar /app/customers-query-side-service.jar
|
||||||
|
ports:
|
||||||
|
- "8084:8080"
|
||||||
|
environment:
|
||||||
|
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
||||||
|
|
||||||
|
mongodb:
|
||||||
|
image: mongo:3.0.4
|
||||||
|
hostname: mongodb
|
||||||
|
command: mongod --smallfiles
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
@@ -1,11 +1,61 @@
|
|||||||
|
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:
|
apigateway:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: apigateway
|
||||||
volumes:
|
volumes:
|
||||||
- ./api-gateway-service/build/libs:/app
|
- ./api-gateway-service/build/libs:/app
|
||||||
command: java -jar /app/api-gateway-service.jar --accounts.commandside.service.host=accountscommandside --transfers.commandside.service.host=transactionscommandside --accounts.queryside.service.host=accountsqueryside --customers.commandside.service.host=customerscommandside --customers.queryside.service.host=customersqueryside
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
links:
|
links:
|
||||||
- accountscommandside
|
- accountscommandside
|
||||||
- transactionscommandside
|
- transactionscommandside
|
||||||
@@ -13,117 +63,126 @@ apigateway:
|
|||||||
- customerscommandside
|
- customerscommandside
|
||||||
- customersqueryside
|
- customersqueryside
|
||||||
- mongodb
|
- mongodb
|
||||||
|
- mysql
|
||||||
|
- kafka
|
||||||
|
- zookeeper
|
||||||
environment:
|
environment:
|
||||||
SPRING_DATASOURCE_URL:
|
|
||||||
SPRING_DATASOURCE_USERNAME:
|
|
||||||
SPRING_DATASOURCE_PASSWORD:
|
|
||||||
SPRING_DATASOURCE_DRIVER_CLASS_NAME:
|
|
||||||
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS:
|
|
||||||
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING:
|
|
||||||
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_USER_NAME:
|
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_PASSWORD:
|
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
|
||||||
|
|
||||||
accountscommandside:
|
accountscommandside:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: accountscommandside
|
||||||
volumes:
|
volumes:
|
||||||
- ./accounts-command-side-service/build/libs:/app
|
- ./accounts-command-side-service/build/libs:/app
|
||||||
command: java -jar /app/accounts-command-side-service.jar
|
links:
|
||||||
ports:
|
- mysql
|
||||||
- "8085:8080"
|
- kafka
|
||||||
|
- zookeeper
|
||||||
environment:
|
environment:
|
||||||
SPRING_DATASOURCE_URL:
|
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
|
||||||
SPRING_DATASOURCE_USERNAME:
|
SPRING_DATASOURCE_USERNAME: mysqluser
|
||||||
SPRING_DATASOURCE_PASSWORD:
|
SPRING_DATASOURCE_PASSWORD: mysqlpw
|
||||||
SPRING_DATASOURCE_DRIVER_CLASS_NAME:
|
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver
|
||||||
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS:
|
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
|
||||||
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING:
|
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_USER_NAME:
|
EVENTUATELOCAL_CDC_DB_USER_NAME: root
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_PASSWORD:
|
EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword
|
||||||
|
|
||||||
|
|
||||||
transactionscommandside:
|
transactionscommandside:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: transactionscommandside
|
||||||
volumes:
|
volumes:
|
||||||
- ./transactions-command-side-service/build/libs:/app
|
- ./transactions-command-side-service/build/libs:/app
|
||||||
command: java -jar /app/transactions-command-side-service.jar
|
links:
|
||||||
ports:
|
- mysql
|
||||||
- "8082:8080"
|
- kafka
|
||||||
|
- zookeeper
|
||||||
environment:
|
environment:
|
||||||
SPRING_DATASOURCE_URL:
|
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
|
||||||
SPRING_DATASOURCE_USERNAME:
|
SPRING_DATASOURCE_USERNAME: mysqluser
|
||||||
SPRING_DATASOURCE_PASSWORD:
|
SPRING_DATASOURCE_PASSWORD: mysqlpw
|
||||||
SPRING_DATASOURCE_DRIVER_CLASS_NAME:
|
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver
|
||||||
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS:
|
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
|
||||||
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING:
|
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_USER_NAME:
|
EVENTUATELOCAL_CDC_DB_USER_NAME: root
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_PASSWORD:
|
EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
accountsqueryside:
|
accountsqueryside:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: accountsqueryside
|
||||||
volumes:
|
volumes:
|
||||||
- ./accounts-query-side-service/build/libs:/app
|
- ./accounts-query-side-service/build/libs:/app
|
||||||
command: java -jar /app/accounts-query-side-service.jar
|
|
||||||
ports:
|
|
||||||
- "8081:8080"
|
|
||||||
links:
|
links:
|
||||||
- mongodb
|
- mongodb
|
||||||
|
- mysql
|
||||||
|
- kafka
|
||||||
|
- zookeeper
|
||||||
environment:
|
environment:
|
||||||
SPRING_DATASOURCE_URL:
|
|
||||||
SPRING_DATASOURCE_USERNAME:
|
|
||||||
SPRING_DATASOURCE_PASSWORD:
|
|
||||||
SPRING_DATASOURCE_DRIVER_CLASS_NAME:
|
|
||||||
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS:
|
|
||||||
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
||||||
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING:
|
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_USER_NAME:
|
SPRING_DATASOURCE_USERNAME: mysqluser
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_PASSWORD:
|
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
|
||||||
|
|
||||||
|
|
||||||
customerscommandside:
|
customerscommandside:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: customerscommandside
|
||||||
volumes:
|
volumes:
|
||||||
- ./customers-command-side-service/build/libs:/app
|
- ./customers-command-side-service/build/libs:/app
|
||||||
command: java -jar /app/customers-command-side-service.jar
|
links:
|
||||||
ports:
|
- mysql
|
||||||
- "8083:8080"
|
- kafka
|
||||||
|
- zookeeper
|
||||||
environment:
|
environment:
|
||||||
SPRING_DATASOURCE_URL:
|
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
|
||||||
SPRING_DATASOURCE_USERNAME:
|
SPRING_DATASOURCE_USERNAME: mysqluser
|
||||||
SPRING_DATASOURCE_PASSWORD:
|
SPRING_DATASOURCE_PASSWORD: mysqlpw
|
||||||
SPRING_DATASOURCE_DRIVER_CLASS_NAME:
|
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver
|
||||||
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS:
|
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
|
||||||
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING:
|
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_USER_NAME:
|
EVENTUATELOCAL_CDC_DB_USER_NAME: root
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_PASSWORD:
|
EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword
|
||||||
|
|
||||||
customersqueryside:
|
customersqueryside:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: customersqueryside
|
||||||
volumes:
|
volumes:
|
||||||
- ./customers-query-side-service/build/libs:/app
|
- ./customers-query-side-service/build/libs:/app
|
||||||
command: java -jar /app/customers-query-side-service.jar
|
|
||||||
ports:
|
|
||||||
- "8084:8080"
|
|
||||||
links:
|
links:
|
||||||
- mongodb
|
- mongodb
|
||||||
|
- mysql
|
||||||
|
- kafka
|
||||||
|
- zookeeper
|
||||||
environment:
|
environment:
|
||||||
SPRING_DATASOURCE_URL:
|
|
||||||
SPRING_DATASOURCE_USERNAME:
|
|
||||||
SPRING_DATASOURCE_PASSWORD:
|
|
||||||
SPRING_DATASOURCE_DRIVER_CLASS_NAME:
|
|
||||||
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS:
|
|
||||||
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING:
|
|
||||||
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_USER_NAME:
|
environment:
|
||||||
EVENTUATELOCAL_EMBEDDED_CDC_DB_PASSWORD:
|
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
||||||
|
SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
|
||||||
mongodb:
|
SPRING_DATASOURCE_USERNAME: mysqluser
|
||||||
image: mongo:3.0.4
|
SPRING_DATASOURCE_PASSWORD: mysqlpw
|
||||||
hostname: mongodb
|
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver
|
||||||
command: mongod --smallfiles
|
EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
|
||||||
ports:
|
EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
|
||||||
- "27017:27017"
|
EVENTUATELOCAL_CDC_DB_USER_NAME: root
|
||||||
|
EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
apigateway:
|
apigateway:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: apigateway
|
||||||
volumes:
|
volumes:
|
||||||
- ./api-gateway-service/build/libs:/app
|
- ./api-gateway-service/build/libs:/app
|
||||||
command: java -jar /app/api-gateway-service.jar --accounts.commandside.service.host=accountscommandside --transfers.commandside.service.host=transactionscommandside --accounts.queryside.service.host=accountsqueryside --customers.commandside.service.host=customerscommandside --customers.queryside.service.host=customersqueryside
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
links:
|
links:
|
||||||
- accountscommandside
|
- accountscommandside
|
||||||
- transactionscommandside
|
- transactionscommandside
|
||||||
@@ -14,80 +12,66 @@ apigateway:
|
|||||||
- customersqueryside
|
- customersqueryside
|
||||||
- mongodb
|
- mongodb
|
||||||
environment:
|
environment:
|
||||||
EVENTUATE_API_KEY_ID:
|
EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID}
|
||||||
EVENTUATE_API_KEY_SECRET:
|
EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET}
|
||||||
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
|
||||||
|
|
||||||
accountscommandside:
|
accountscommandside:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: accountscommandside
|
||||||
volumes:
|
volumes:
|
||||||
- ./accounts-command-side-service/build/libs:/app
|
- ./accounts-command-side-service/build/libs:/app
|
||||||
command: java -jar /app/accounts-command-side-service.jar
|
|
||||||
ports:
|
|
||||||
- "8085:8080"
|
|
||||||
environment:
|
environment:
|
||||||
EVENTUATE_API_KEY_ID:
|
EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID}
|
||||||
EVENTUATE_API_KEY_SECRET:
|
EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET}
|
||||||
|
|
||||||
transactionscommandside:
|
transactionscommandside:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: transactionscommandside
|
||||||
volumes:
|
volumes:
|
||||||
- ./transactions-command-side-service/build/libs:/app
|
- ./transactions-command-side-service/build/libs:/app
|
||||||
command: java -jar /app/transactions-command-side-service.jar
|
|
||||||
ports:
|
|
||||||
- "8082:8080"
|
|
||||||
environment:
|
environment:
|
||||||
EVENTUATE_API_KEY_ID:
|
EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID}
|
||||||
EVENTUATE_API_KEY_SECRET:
|
EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET}
|
||||||
|
|
||||||
|
|
||||||
accountsqueryside:
|
accountsqueryside:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: accountsqueryside
|
||||||
volumes:
|
volumes:
|
||||||
- ./accounts-query-side-service/build/libs:/app
|
- ./accounts-query-side-service/build/libs:/app
|
||||||
command: java -jar /app/accounts-query-side-service.jar
|
|
||||||
ports:
|
|
||||||
- "8081:8080"
|
|
||||||
links:
|
links:
|
||||||
- mongodb
|
- mongodb
|
||||||
environment:
|
environment:
|
||||||
EVENTUATE_API_KEY_ID:
|
EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID}
|
||||||
EVENTUATE_API_KEY_SECRET:
|
EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET}
|
||||||
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
|
||||||
|
|
||||||
customerscommandside:
|
customerscommandside:
|
||||||
image: java:openjdk-8u91-jdk
|
extends:
|
||||||
working_dir: /app
|
file: docker-compose-common.yml
|
||||||
|
service: customerscommandside
|
||||||
volumes:
|
volumes:
|
||||||
- ./customers-command-side-service/build/libs:/app
|
- ./customers-command-side-service/build/libs:/app
|
||||||
command: java -jar /app/customers-command-side-service.jar
|
|
||||||
ports:
|
|
||||||
- "8083:8080"
|
|
||||||
environment:
|
environment:
|
||||||
EVENTUATE_API_KEY_ID:
|
EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID}
|
||||||
EVENTUATE_API_KEY_SECRET:
|
EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET}
|
||||||
|
|
||||||
customersqueryside:
|
customersqueryside:
|
||||||
|
extends:
|
||||||
|
file: docker-compose-common.yml
|
||||||
|
service: customersqueryside
|
||||||
image: java:openjdk-8u91-jdk
|
image: java:openjdk-8u91-jdk
|
||||||
working_dir: /app
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./customers-query-side-service/build/libs:/app
|
- ./customers-query-side-service/build/libs:/app
|
||||||
command: java -jar /app/customers-query-side-service.jar
|
|
||||||
ports:
|
|
||||||
- "8084:8080"
|
|
||||||
links:
|
links:
|
||||||
- mongodb
|
- mongodb
|
||||||
environment:
|
environment:
|
||||||
EVENTUATE_API_KEY_ID:
|
EVENTUATE_API_KEY_ID: ${EVENTUATE_API_KEY_ID}
|
||||||
EVENTUATE_API_KEY_SECRET:
|
EVENTUATE_API_KEY_SECRET: ${EVENTUATE_API_KEY_SECRET}
|
||||||
SPRING_DATA_MONGODB_URI: mongodb://mongodb/mydb
|
|
||||||
|
|
||||||
mongodb:
|
mongodb:
|
||||||
image: mongo:3.0.4
|
extends:
|
||||||
hostname: mongodb
|
file: docker-compose-common.yml
|
||||||
command: mongod --smallfiles
|
service: mongodb
|
||||||
ports:
|
|
||||||
- "27017:27017"
|
|
||||||
|
|||||||
@@ -5,6 +5,5 @@ eventuateMavenRepoUrl=http://mavenrepo.eventuate.io/release
|
|||||||
|
|
||||||
springBootVersion=1.3.5.RELEASE
|
springBootVersion=1.3.5.RELEASE
|
||||||
|
|
||||||
eventuateClientVersion=0.8.0.RELEASE
|
eventuateClientVersion=0.10.0.RELEASE
|
||||||
eventuateLocalVersion=0.2.0.RELEASE
|
eventuateLocalVersion=0.4.0.RELEASE
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
docker run --link javaspring_mongodb_1:mongodb -i -t mongo:3.0.4 /usr/bin/mongo --host mongodb
|
docker run --rm --link javaspring_mongodb_1:mongodb -i -t mongo:3.0.4 /usr/bin/mongo --host mongodb
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ dependencies {
|
|||||||
compile "org.springframework.boot:spring-boot-starter-actuator"
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
||||||
|
|
||||||
compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion"
|
compile "io.eventuate.client.java:eventuate-client-java-http-stomp-spring:$eventuateClientVersion"
|
||||||
|
compile project(":common-swagger")
|
||||||
|
|
||||||
testCompile project(":testutil")
|
testCompile project(":testutil")
|
||||||
testCompile "org.springframework.boot:spring-boot-starter-test"
|
testCompile "org.springframework.boot:spring-boot-starter-test"
|
||||||
@@ -27,4 +28,4 @@ task copyWebStatic(type: Copy) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jar.dependsOn(copyWebStatic)
|
jar.dependsOn(copyWebStatic)
|
||||||
bootRun.dependsOn(copyWebStatic)
|
bootRun.dependsOn(copyWebStatic)
|
||||||
|
|||||||
21
java-spring/set-env.sh
Normal file
21
java-spring/set-env.sh
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
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
|
||||||
|
|
||||||
7
java-spring/show-urls.sh
Executable file
7
java-spring/show-urls.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
IP=$(docker-machine ip default)
|
||||||
|
|
||||||
|
echo Accounts command-side service = http://${IP}:8080/swagger-ui.html
|
||||||
|
echo Money Transfers command-side service = http://${IP}:8082/swagger-ui.html
|
||||||
|
echo Accounts query-side service = http://${IP}:8081/swagger-ui.html
|
||||||
@@ -13,6 +13,7 @@ while [[ "$done" = false ]]; do
|
|||||||
done=true
|
done=true
|
||||||
else
|
else
|
||||||
done=false
|
done=false
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [[ "$done" = true ]]; then
|
if [[ "$done" = true ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user