From fbcfeff2b60b92a6409ff14ddbee0c070b668cad Mon Sep 17 00:00:00 2001 From: amaljoyc Date: Fri, 12 Oct 2018 20:36:14 +0200 Subject: [PATCH] user postgres --- README.md | 2 +- cqrs-sink/pom.xml | 5 +++-- .../src/main/resources/application.properties | 6 ++--- cqrs-source/pom.xml | 5 +++-- .../src/main/resources/application.properties | 6 ++--- docker-compose.yaml | 22 +++++++++---------- 6 files changed, 24 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 9b2aeb1..3a9bea0 100644 --- a/README.md +++ b/README.md @@ -10,5 +10,5 @@ Spring boot app using DDD, CQRS, Kafka etc * Spring Data JPA * Maven * Kafka -* MySQL +* Postgresql * Docker Compose diff --git a/cqrs-sink/pom.xml b/cqrs-sink/pom.xml index f007471..5fce86a 100644 --- a/cqrs-sink/pom.xml +++ b/cqrs-sink/pom.xml @@ -61,8 +61,9 @@ - mysql - mysql-connector-java + org.postgresql + postgresql + runtime diff --git a/cqrs-sink/src/main/resources/application.properties b/cqrs-sink/src/main/resources/application.properties index e56a7a0..4198217 100644 --- a/cqrs-sink/src/main/resources/application.properties +++ b/cqrs-sink/src/main/resources/application.properties @@ -1,11 +1,11 @@ -spring.datasource.url=jdbc:mysql://mysql:3306/sinkdb?autoReconnect=true&useSSL=false +spring.datasource.url=jdbc:postgresql://db:5432/mydb spring.datasource.username=myuser spring.datasource.password=mypwd -spring.datasource.platform=mysql +spring.datasource.platform=postgres spring.datasource.initialization-mode=always spring.jpa.hibernate.ddl-auto=none -spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect +spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQL9Dialect spring.cloud.stream.kafka.binder.brokers=kafka:9092 spring.cloud.stream.bindings.input.destination=events diff --git a/cqrs-source/pom.xml b/cqrs-source/pom.xml index 63a62ee..3b344bc 100644 --- a/cqrs-source/pom.xml +++ b/cqrs-source/pom.xml @@ -61,8 +61,9 @@ - mysql - mysql-connector-java + org.postgresql + postgresql + runtime diff --git a/cqrs-source/src/main/resources/application.properties b/cqrs-source/src/main/resources/application.properties index a5be165..94083e1 100644 --- a/cqrs-source/src/main/resources/application.properties +++ b/cqrs-source/src/main/resources/application.properties @@ -1,11 +1,11 @@ -spring.datasource.url=jdbc:mysql://mysql:3306/sourcedb?autoReconnect=true&useSSL=false +spring.datasource.url=jdbc:postgresql://db:5432/mydb spring.datasource.username=myuser spring.datasource.password=mypwd -spring.datasource.platform=mysql +spring.datasource.platform=postgres spring.datasource.initialization-mode=always spring.jpa.hibernate.ddl-auto=none -spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect +spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQL9Dialect spring.cloud.stream.kafka.binder.brokers=kafka:9092 spring.cloud.stream.bindings.output.destination=events diff --git a/docker-compose.yaml b/docker-compose.yaml index f1b9ec5..c7f445f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,4 @@ -version: "2" +version: '2.2' services: sink: @@ -6,7 +6,7 @@ services: ports: - 8081:8081 links: - - mysql + - db - kafka source: @@ -14,17 +14,17 @@ services: ports: - 8080:8080 links: - - mysql + - db - kafka - mysql: - image: mysql - ports: - - 3306:3306 - environment: - - MYSQL_ROOT_PASSWORD=root - - MYSQL_USER=myuser - - MYSQL_PASSWORD=mypwd + db: + image: postgres + ports: + - 5432:5432 + environment: + - POSTGRES_USER=myuser + - POSTGRES_PASSWORD=mypwd + - POSTGRES_DB=mydb zookeeper: image: confluent/zookeeper