Skip to content
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
7 changes: 3 additions & 4 deletions saga/local-resources/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ services:
image: "quay.io/jbosstm/lra-coordinator:latest"
network_mode: "host"
amq-broker:
image: "registry.redhat.io/amq7/amq-broker-rhel8:7.12"
image: "apache/artemis:latest-alpine"
environment:
- AMQ_USER=admin
- AMQ_PASSWORD=admin
- AMQ_REQUIRE_LOGIN=true
- ARTEMIS_USER=admin
- ARTEMIS_PASSWORD=admin
ports:
- "8161:8161"
- "61616:61616"
8 changes: 3 additions & 5 deletions saga/ocp-resources/amq-broker-ephemeral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ items:
tags:
- from:
kind: DockerImage
name: registry.redhat.io/amq7/amq-broker-rhel8:7.12
name: apache/artemis:latest-alpine
generation: 0
name: "latest"
referencePolicy:
Expand Down Expand Up @@ -67,12 +67,10 @@ items:
- imagePullPolicy: IfNotPresent
image: "amq-broker:latest"
env:
- name: AMQ_USER
- name: ARTEMIS_USER
value: admin
- name: AMQ_PASSWORD
- name: ARTEMIS_PASSWORD
value: admin
- name: AMQ_REQUIRE_LOGIN
value: "true"
livenessProbe:
httpGet:
path: /
Expand Down
12 changes: 4 additions & 8 deletions saga/ocp-resources/amq-broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ items:
tags:
- from:
kind: DockerImage
name: registry.redhat.io/amq7/amq-broker-rhel8:7.12
name: apache/artemis:latest-alpine
generation: 0
name: "latest"
referencePolicy:
Expand Down Expand Up @@ -80,14 +80,10 @@ items:
- imagePullPolicy: IfNotPresent
image: "amq-broker:latest"
env:
- name: AMQ_USER
- name: ARTEMIS_USER
value: admin
- name: AMQ_PASSWORD
- name: ARTEMIS_PASSWORD
value: admin
- name: AMQ_REQUIRE_LOGIN
value: "true"
- name: AMQ_DATA_DIR
value: /data
livenessProbe:
httpGet:
path: /
Expand All @@ -107,7 +103,7 @@ items:
scheme: HTTP
initialDelaySeconds: 10
volumeMounts:
- mountPath: /data
- mountPath: /var/lib/artemis-instance
name: amq-broker-data
volumes:
- name: amq-broker-data
Expand Down
4 changes: 4 additions & 0 deletions saga/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
</dependency>

<!-- artemis jms pooled connections-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-artemis</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jakarta-client</artifactId>
Expand Down
12 changes: 8 additions & 4 deletions saga/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ echo compiling project
mvn clean package

echo running payment service
mvn -f saga-payment-service/ spring-boot:run &
mvn -f saga-payment-service/ spring-boot:run > payment.log 2>&1 &
echo $! > payment.pid

echo running flight service
mvn -f saga-flight-service/ spring-boot:run &
mvn -f saga-flight-service/ spring-boot:run > flight.log 2>&1 &
echo $! > flight.pid

echo running train service
mvn -f saga-train-service/ spring-boot:run &
mvn -f saga-train-service/ spring-boot:run > train.log 2>&1 &
echo $! > train.pid

echo running saga application
mvn -f saga-app/ spring-boot:run &
mvn -f saga-app/ spring-boot:run > app.log 2>&1 &
echo $! > app.pid

wait
17 changes: 13 additions & 4 deletions saga/stop-local.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
#!/bin/bash

# mvn spring-boot:run always forks a child JVM, so the pid files hold the
# mvn process id, not the actual Spring Boot process; kill the forked
# child(ren) first, then the mvn process itself.
kill_mvn_and_children() {
local pid="$1"
pkill -9 -P "$pid" 2>/dev/null
kill -9 "$pid" 2>/dev/null
}

echo stopping saga application
kill -9 $(cat app.pid) && rm app.pid
kill_mvn_and_children $(cat app.pid) && rm app.pid

echo stopping flight service
kill -9 $(cat flight.pid) && rm flight.pid
kill_mvn_and_children $(cat flight.pid) && rm flight.pid

echo stopping train service
kill -9 $(cat train.pid) && rm train.pid
kill_mvn_and_children $(cat train.pid) && rm train.pid

echo stopping payment service
kill -9 $(cat payment.pid) && rm payment.pid
kill_mvn_and_children $(cat payment.pid) && rm payment.pid

echo stopping amq broker and lra-coordinator
docker compose -f local-resources/compose.yaml stop
Loading