From 6157d9ef03bc15518c1283bd423e87675474746a Mon Sep 17 00:00:00 2001 From: johnpapwinter Date: Tue, 26 Nov 2024 16:33:36 +0200 Subject: [PATCH] added messaging queue dependencies and image to dev compose --- docker-compose.db.yml | 19 +++++++++++++++++-- .../{V1_SeedData.java => V0_SeedDevData.java} | 4 +++- orders/pom.xml | 4 ++++ 3 files changed, 24 insertions(+), 3 deletions(-) rename logging/src/main/java/com/example/logging/migrations/{V1_SeedData.java => V0_SeedDevData.java} (92%) diff --git a/docker-compose.db.yml b/docker-compose.db.yml index 1d6a17e..0b2e630 100644 --- a/docker-compose.db.yml +++ b/docker-compose.db.yml @@ -1,4 +1,3 @@ -version: '3.8' services: postgres: @@ -22,6 +21,22 @@ services: volumes: - mongo_data:/data/db + rabbitmq: + image: rabbitmq:3-management + container_name: rabbitmq + ports: + - "5672:5672" + - "15672:15672" + environment: + RABBITMQ_DEFAULT_USER: guest + RABBITMQ_DEFAULT_PASS: guest + volumes: + - rabbitmq_data:/var/lib/rabbitmq + - rabbitmq_log:/var/log/rabbitmq + + volumes: postgres_data: - mongo_data: \ No newline at end of file + mongo_data: + rabbitmq_data: + rabbitmq_log: diff --git a/logging/src/main/java/com/example/logging/migrations/V1_SeedData.java b/logging/src/main/java/com/example/logging/migrations/V0_SeedDevData.java similarity index 92% rename from logging/src/main/java/com/example/logging/migrations/V1_SeedData.java rename to logging/src/main/java/com/example/logging/migrations/V0_SeedDevData.java index 783c25e..c6468c1 100644 --- a/logging/src/main/java/com/example/logging/migrations/V1_SeedData.java +++ b/logging/src/main/java/com/example/logging/migrations/V0_SeedDevData.java @@ -4,14 +4,16 @@ import io.mongock.api.annotations.ChangeUnit; import io.mongock.api.annotations.Execution; import io.mongock.api.annotations.RollbackExecution; +import org.springframework.context.annotation.Profile; import org.springframework.data.mongodb.core.MongoTemplate; import java.time.LocalDate; import java.util.Arrays; import java.util.List; +@Profile("dev") @ChangeUnit(id = "seed-logged-orders", order = "001", author = "johnpapwinter") -public class V1_SeedData { +public class V0_SeedDevData { @Execution public void changeSet(MongoTemplate mongoTemplate) { diff --git a/orders/pom.xml b/orders/pom.xml index f029f93..e48bd71 100644 --- a/orders/pom.xml +++ b/orders/pom.xml @@ -49,6 +49,10 @@ org.springframework.boot spring-boot-starter-web + + org.springframework.boot + spring-boot-starter-amqp + org.springframework.cloud spring-cloud-starter-openfeign