Skip to content

Development #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1
setup: true
orbs:
eventuate-gradle-build-and-test: "eventuate_io/[email protected].1"
eventuate-gradle-build-and-test: "eventuate_io/[email protected].9"
continuation: circleci/[email protected]
jobs:
setup:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/generate-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cat > generated_config.yml <<END
version: 2.1
orbs:
eventuate-gradle-build-and-test: "eventuate_io/[email protected].1"
eventuate-gradle-build-and-test: "eventuate_io/[email protected].9"
workflows:
version: 2.1
build-test-and-deploy:
Expand Down
6 changes: 6 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
= An Eventuate project

image::https://eventuate.io/i/logo.gif[]

This project is part of http://eventuate.io[Eventuate], which is a microservices collaboration platform.

= FTGO example application

This is the example code for my book https://microservices.io/book[Microservice patterns].
Expand Down
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ dockerCompose {

infrastructure {
projectName = null
startedServices = ["mysql", "cdc-service", "dynamodblocal-init", "kafka", "zookeeper"]
startedServices = ["mysql", "dynamodblocal-init", "kafka", "zookeeper"]
}

// TODO with flyway - initialize after services

eventuateCdcService {
projectName = null
startedServices = ["cdc-service"]
}

kafkaGui {
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/groovy/FtgoServicePlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class FtgoServicePlugin implements Plugin<Project> {
compile 'org.springframework.cloud:spring-cloud-starter-zipkin'
compile "io.zipkin.brave:brave-bom:4.17.1"

implementation "io.eventuate.tram.core:eventuate-tram-spring-flyway"
runtimeOnly "io.eventuate.tram.sagas:eventuate-tram-sagas-spring-flyway"

// Temporarily disable
//compile "io.eventuate.tram.core:eventuate-tram-spring-cloud-sleuth-integration"

Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ services:
EVENTUATE_CDC_PIPELINE_PIPELINE8_EVENTUATEDATABASESCHEMA: ftgo_delivery_service

EVENTUATE_CDC_READER_READER1_TYPE: mysql-binlog
EVENTUATE_CDC_READER_READER1_DATASOURCEURL: jdbc:mysql://mysql:3306/eventuate
EVENTUATE_CDC_READER_READER1_DATASOURCEURL: jdbc:mysql://mysql:3306/ftgo_delivery_service
EVENTUATE_CDC_READER_READER1_MONITORINGSCHEMA: ftgo_delivery_service
EVENTUATE_CDC_READER_READER1_DATASOURCEUSERNAME: root
EVENTUATE_CDC_READER_READER1_DATASOURCEPASSWORD: rootpassword
EVENTUATE_CDC_READER_READER1_DATASOURCEDRIVERCLASSNAME: com.mysql.jdbc.Driver
Expand Down
2 changes: 1 addition & 1 deletion dynamodblocal-init/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:2.7.16-alpine3.9
FROM python:3.11.5-alpine3.18
RUN pip install awscli --upgrade
COPY create-dynamodb-tables.sh .
COPY ftgo-order-history.json .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration;

@Configuration
@EnableAutoConfiguration
@Import({AccountingMessagingConfiguration.class, AccountingWebConfiguration.class,
TramCommandProducerConfiguration.class,
EventuateDriverConfiguration.class,
TramJdbcKafkaConfiguration.class,
CommonSwaggerConfiguration.class})
CommonSwaggerConfiguration.class,
EventuateTramFlywayMigrationConfiguration.class})
public class AccountingServiceMain {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver

eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092
eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181

spring.flyway.locations=classpath:flyway/{vendor}
spring.flyway.baseline-on-migrate=true
spring.flyway.baseline-version=0

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration;

@SpringBootApplication
@Import({ConsumerWebConfiguration.class, TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class})
@Import({ConsumerWebConfiguration.class, TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class, EventuateTramFlywayMigrationConfiguration.class})
public class ConsumerServiceMain {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver

eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092
eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181

spring.flyway.locations=classpath:flyway/{vendor}
spring.flyway.baseline-on-migrate=true
spring.flyway.baseline-version=0

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration;

@Configuration
@EnableAutoConfiguration
@Import({DeliveryServiceMessagingConfiguration.class, DeliveryServiceWebConfiguration.class,
TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class
TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class, EventuateTramFlywayMigrationConfiguration.class
})
public class DeliveryServiceMain {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver

eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092
eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181

spring.flyway.locations=classpath:flyway/{vendor}
spring.flyway.baseline-on-migrate=true
spring.flyway.baseline-version=0

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration;

@SpringBootApplication
@Import({KitchenServiceWebConfiguration.class,
KitchenServiceMessageHandlersConfiguration.class,
TramJdbcKafkaConfiguration.class,
CommonSwaggerConfiguration.class})
CommonSwaggerConfiguration.class,
EventuateTramFlywayMigrationConfiguration.class})
public class KitchenServiceMain {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver

eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092
eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181

spring.flyway.locations=classpath:flyway/{vendor}
spring.flyway.baseline-on-migrate=true
spring.flyway.baseline-version=0

Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration;

@SpringBootApplication
@Import({OrderWebConfiguration.class, OrderCommandHandlersConfiguration.class, OrderServiceMessagingConfiguration.class,
TramJdbcKafkaConfiguration.class, CommonSwaggerConfiguration.class, GrpcConfiguration.class,
MicroserviceCanvasWebConfiguration.class})
MicroserviceCanvasWebConfiguration.class, EventuateTramFlywayMigrationConfiguration.class})
@ServiceDescription(description="Manages Orders", capabilities = "Order Management")
public class OrderServiceMain {

Expand Down
5 changes: 5 additions & 0 deletions ftgo-order-service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver

eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092
eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181

spring.flyway.locations=classpath:flyway/{vendor}
spring.flyway.baseline-on-migrate=true
spring.flyway.baseline-version=0

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;
import io.eventuate.tram.spring.flyway.EventuateTramFlywayMigrationConfiguration;

@SpringBootApplication
@Import(TramJdbcKafkaConfiguration.class)
@Import({TramJdbcKafkaConfiguration.class, EventuateTramFlywayMigrationConfiguration.class})
public class RestaurantServiceMain {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver

eventuatelocal.kafka.bootstrap.servers=${DOCKER_HOST_IP:localhost}:9092
eventuatelocal.zookeeper.connection.string=${DOCKER_HOST_IP:localhost}:2181

spring.flyway.locations=classpath:flyway/{vendor}
spring.flyway.baseline-on-migrate=true
spring.flyway.baseline-version=0

18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ springCloudContractDependenciesVersion=2.2.0.RELEASE

springDependencyManagementPluginVersion=1.0.3.RELEASE

eventuateCommonVersion=0.15.0.RELEASE
eventuatePlatformVersion=2022.0.RELEASE
eventuateCommonVersion=0.18.0.RELEASE
eventuatePlatformVersion=2023.1.RELEASE


eventuateCommonImageVersion=0.15.0.RELEASE
eventuateMessagingKafkaImageVersion=0.15.0.RELEASE
eventuateCdcImageVersion=0.13.0.RELEASE
eventuateTramSagasImageVersion=0.19.0.RELEASE
eventuateCommonImageVersion=0.18.0.RELEASE
eventuateMessagingKafkaImageVersion=0.18.0.RELEASE
eventuateCdcImageVersion=0.16.0.RELEASE
eventuateTramSagasImageVersion=0.23.0.RELEASE

protocVersion=3.20.1
grpcVersion = 1.47.0

swaggerUiVersion=3.23.11
eventuateExamplesBaseImageVersion=BUILD-15

dockerComposePluginVersion=0.15.2
dockerComposePluginVersion=0.16.12
springCloudSleuthVersion=2.2.2.RELEASE
springCloudGatewayVersion=2.0.0.RELEASE
micrometerVersion=1.0.4

microserviceCanvasVersion=0.8.0.RELEASE
microserviceCanvasVersion=0.11.0.RELEASE
swaggerRequestValidatorVersion=2.8.3
js2pVersion=1.0.1

eventuatePlatformVersion=2022.0.RELEASE
eventuatePlatformVersion=2023.1.RELEASE
9 changes: 2 additions & 7 deletions mysql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
ARG EVENTUATE_COMMON_VERSION
FROM eventuateio/eventuate-mysql8:$EVENTUATE_COMMON_VERSION
FROM eventuateio/eventuate-vanilla-mysql8:$EVENTUATE_COMMON_VERSION
ARG EVENTUATE_COMMON_VERSION
ARG EVENTUATE_SAGA_VERSION

COPY compile-schema-per-service.sh /docker-entrypoint-initdb.d/4.compile-schema-per-service.sh

ADD https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/$EVENTUATE_COMMON_VERSION/mysql/1.initialize-database.sql /docker-entrypoint-initdb.d/template1
ADD https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/$EVENTUATE_COMMON_VERSION/mysql/2.initialize-database.sql /docker-entrypoint-initdb.d/template2
ADD https://raw.githubusercontent.com/eventuate-tram/eventuate-tram-sagas/$EVENTUATE_SAGA_VERSION/mysql/tram-saga-schema.sql /docker-entrypoint-initdb.d/template3

RUN cat /docker-entrypoint-initdb.d/template? | sed -e 's/eventuate.offset_store/offset_store/' -e /eventuate/d > /docker-entrypoint-initdb.d/template

RUN touch /docker-entrypoint-initdb.d/5.schema-per-service.sql

RUN chown mysql -R /docker-entrypoint-initdb.d
1 change: 0 additions & 1 deletion mysql/compile-schema-per-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ do
GRANT ALL PRIVILEGES ON $schema.* TO '${user}'@'%' WITH GRANT OPTION;
USE $schema;
END
cat /docker-entrypoint-initdb.d/template >> /docker-entrypoint-initdb.d/5.schema-per-service.sql
done