Skip to content

Commit 23100ff

Browse files
Merge pull request #133 from Clariteia/issue-126-migrate-ticket-microservice
Migrate `ticket` microservice to latest minos version
2 parents 0d8b5a3 + aa81eb6 commit 23100ff

File tree

19 files changed

+1289
-565
lines changed

19 files changed

+1289
-565
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
on:
2+
push:
3+
paths:
4+
- 'microservices/ticket/**'
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
container: python:3.9-buster
10+
services:
11+
postgres:
12+
image: postgres
13+
env:
14+
POSTGRES_DB: ticket_db
15+
POSTGRES_USER: minos
16+
POSTGRES_PASSWORD: min0s
17+
ports:
18+
- 5432:5432
19+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
20+
21+
zookeeper:
22+
image: wurstmeister/zookeeper:latest
23+
ports:
24+
- 2181:2181
25+
26+
kafka:
27+
image: wurstmeister/kafka:latest
28+
ports:
29+
- 9092:9092
30+
env:
31+
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
32+
KAFKA_ADVERTISED_HOST_NAME: kafka
33+
defaults:
34+
run:
35+
working-directory: ./microservices/ticket
36+
37+
env:
38+
MINOS_REPOSITORY_HOST: postgres
39+
MINOS_SNAPSHOT_HOST: postgres
40+
MINOS_BROKER_QUEUE_HOST: postgres
41+
MINOS_BROKER_HOST: kafka
42+
43+
steps:
44+
- name: Check out repository code
45+
uses: actions/checkout@v2
46+
47+
- name: Install Poetry
48+
uses: snok/[email protected]
49+
50+
- name: Install dependencies
51+
run: poetry install
52+
53+
- name: Run tests
54+
run: poetry run pytest

.github/workflows/microservice-user-tests.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@ jobs:
3535
working-directory: ./microservices/user
3636

3737
env:
38-
MINOS_EVENTS_QUEUE_HOST: postgres
39-
MINOS_EVENTS_BROKER: kafka
40-
MINOS_COMMANDS_QUEUE_HOST: postgres
41-
MINOS_COMMANDS_BROKER: kafka
4238
MINOS_REPOSITORY_HOST: postgres
4339
MINOS_SNAPSHOT_HOST: postgres
44-
MINOS_SAGA_QUEUE_HOST: postgres
40+
MINOS_BROKER_QUEUE_HOST: postgres
41+
MINOS_BROKER_HOST: kafka
4542

4643
steps:
4744
- name: Check out repository code

microservices/product/config.yml

Lines changed: 18 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ service:
55
command_reply_broker: minos.networks.CommandReplyBroker
66
event_broker: minos.networks.EventBroker
77
repository: minos.common.PostgreSqlRepository
8+
reply_pool: minos.networks.ReplyHandlerPool
89
saga_manager: minos.saga.SagaManager
910
snapshot: minos.common.PostgreSqlSnapshot
1011
discovery: minos.networks.DiscoveryConnector
@@ -21,37 +22,17 @@ service:
2122
rest:
2223
host: 0.0.0.0
2324
port: 8084
24-
endpoints:
25-
- route: /products
26-
method: POST
27-
controller: src.ProductCommandService
28-
action: create_product
29-
name: ""
30-
31-
- route: /products/{uuid}/inventory
32-
method: PUT
33-
controller: src.ProductCommandService
34-
action: update_inventory
35-
name: ""
36-
37-
- route: /products/{uuid}/inventory
38-
method: PATCH
39-
controller: src.ProductCommandService
40-
action: update_inventory_diff
41-
name: ""
42-
43-
- route: /products
44-
method: GET
45-
controller: src.ProductCommandService
46-
action: get_products
47-
name: ""
48-
49-
- route: /products/{uuid}
50-
method: DELETE
51-
controller: src.ProductCommandService
52-
action: delete_product
53-
name: ""
54-
25+
broker:
26+
host: localhost
27+
port: 9092
28+
queue:
29+
database: product_db
30+
user: minos
31+
password: min0s
32+
host: localhost
33+
port: 5432
34+
records: 10
35+
retry: 2
5536
repository:
5637
database: product_db
5738
user: minos
@@ -64,72 +45,16 @@ snapshot:
6445
password: min0s
6546
host: localhost
6647
port: 5432
67-
events:
68-
broker: localhost
69-
port: 9092
70-
queue:
71-
database: product_db
72-
user: minos
73-
password: min0s
74-
host: localhost
75-
port: 5432
76-
records: 10
77-
retry: 2
78-
items:
79-
- name: ProductCreated
80-
controller: src.ProductQueryService
81-
action: product_created
82-
- name: ProductUpdated
83-
controller: src.ProductQueryService
84-
action: product_updated
85-
- name: ProductDeleted
86-
controller: src.ProductQueryService
87-
action: product_deleted
8848
commands:
89-
broker: localhost
90-
port: 9092
91-
items:
92-
- name: CreateProduct
93-
controller: src.ProductCommandService
94-
action: create_product
95-
- name: GetProducts
96-
controller: src.ProductCommandService
97-
action: get_products
98-
- name: ReserveProducts
99-
controller: src.ProductCommandService
100-
action: reserve_products
101-
queue:
102-
database: product_db
103-
user: minos
104-
password: min0s
105-
host: localhost
106-
port: 5432
107-
records: 10
108-
retry: 2
49+
service: src.ProductCommandService
50+
queries:
51+
service: src.ProductQueryService
52+
events:
53+
service: src.ProductQueryService
10954
saga:
110-
broker: localhost
111-
port: 9092
11255
storage:
11356
path: "./product.lmdb"
11457
items: []
115-
queue:
116-
database: product_db
117-
user: minos
118-
password: min0s
119-
host: localhost
120-
port: 5432
121-
records: 10
122-
retry: 2
12358
discovery:
12459
host: localhost
125-
port: 5567
126-
endpoints:
127-
subscribe:
128-
path: subscribe
129-
method: POST
130-
unsubscribe:
131-
path: unsubscribe
132-
method: POST
133-
discover:
134-
path: discover
135-
method: GET
60+
port: 5567

0 commit comments

Comments
 (0)