Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rafaelgss/microservice-debezium-outbox

POC - Outbox Pattern refers my article/talk
https://github.com/rafaelgss/microservice-debezium-outbox

Last synced: 2 days ago
JSON representation

POC - Outbox Pattern refers my article/talk

Awesome Lists containing this project

README

        

# microservice-debezium-outbox

```sh
docker-compose up
```

## Kafka

- Zookeeper
- Kafdrop - http://localhost:9000

## Gateway

- `ms-user`: http://localhost:3000/ms-user

## After up

```sh
http POST http://localhost:8083/connectors/ < ms-user/src/connector.json
```

Create a user example
```sh
http POST http://localhost:3000/ms-user/user name=Gonzaga [email protected]
```

So, just go to kafdrop on topic specified in the connector and see the message something like:
```
{
"before":null,
"after":{
"id":2,
"type":"CREATE",
"aggregate_type":"Users",
"aggregate_id":1,
"payload":"{\"name\":\"Gonzaga\",\"email\":\"[email protected]\"}"
},
"source":{
"version":"1.0.2.Final",
"connector":"mysql",
"name":"db-ms-user",
"ts_ms":1583417056000,
"snapshot":"false",
"db":"ms_user",
"table":"outbox",
"server_id":1,
"gtid":null,
"file":"binlog.000022",
"pos":520,
"row":0,
"thread":12,
"query":null
},
"op":"c",
"ts_ms":1583417056193
}
```

**IMPORTANT**: You can format this message for make more sense on this pattern. See [Avro](https://debezium.io/documentation/reference/configuration/avro.html)

## Debug

Database console
```sh
docker run -it --rm --name mysqlterm --network microservicedebeziumoutbox_default --link db-ms-user --rm mysql:5.7 sh -c 'exec mysql -h db-ms-user -uroot -ptoor -D ms_user'
```

Go to localhost:9000 to see topics