Skip to content

Commit dfa8058

Browse files
authored
Merge pull request #148 from RADAR-base/add-graphical-docs
Add graphical docs
2 parents 1aebe6a + 2ee261a commit dfa8058

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,45 @@ docker-compose exec schema-registry-1 kafka-avro-console-consumer \
120120
--topic connect_fitbit_intraday_heart_rate
121121
```
122122

123+
## Flows
124+
125+
The following diagrams shows the flow of the Fitbit source connector. The fitbit source connector is a Kafka Connect source connector that polls the Fitbit API for data. The data is then converted to Avro records and sent to Kafka topics.
126+
127+
### Initialization
128+
129+
On startup, the fitbit connector simply starts up and schedules its regular polling tasks.
130+
131+
```mermaid
132+
sequenceDiagram
133+
participant connector as Fitbit Source Connector
134+
participant kafka as Kafka
135+
136+
connector ->> kafka: Check Kafka readiness (optional)
137+
connector ->> connector: Schedule polling tasks
138+
```
139+
140+
### Regular operation
141+
142+
The Fitbit connector operates by regularly polling the user repository, and regularly polling all configured users for data
143+
144+
```mermaid
145+
sequenceDiagram
146+
participant connector as Fitbit Source Connector
147+
participant userRepo as User Repository (rest-source-auth)
148+
participant fitbit as Fitbit API
149+
participant kafka as Kafka
150+
151+
note over connector: Get users (every 5 minutes)
152+
connector ->> userRepo: Get users @ /users?source-type=FitBit
153+
note over connector: For each user (every 5 seconds)
154+
connector ->> connector: What data should be fetched?
155+
connector ->> userRepo: Get fitbit access token @ users/<id>/token
156+
connector ->> fitbit: Get required data @ api.fitbit.com/1/user/<id>/<data-type>/date/<daterange>
157+
connector ->> kafka: Send data
158+
kafka ->> connector: 200 OK
159+
connector ->> connector: Update offset times
160+
```
161+
123162
## Contributing
124163

125164
Code should be formatted using the [Google Java Code Style Guide](https://google.github.io/styleguide/javaguide.html).

0 commit comments

Comments
 (0)