This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
TODO
44 lines (33 loc) · 1.73 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
producer:
datamodel:
✔ data model @done(20-03-05 11:39)
✔ name as string @done(20-03-05 11:39)
✔ message_id as str from name and uuid.uuid4() @done(20-03-05 11:39)
✔ timestamp as str as datetime.utcnow() @done(20-03-05 11:39)
✔ lat as confloat -90 < x < 90 @done(20-03-05 11:39)
✔ lon as confloat -180 < x < 180 @done(20-03-05 11:39)
✔ test data model @done(20-03-05 11:39)
responsemodel:
✔ add responsemodel @done(20-03-08 10:58)
✔ test responsemodel with monkeypatch @done(20-03-08 10:58)
endpoint:
✔ add /producer/<topicname> endpoint @done(20-03-06 15:34)
✔ add aiokafka producer to handle incoming requests async and not block @done(20-03-06 12:55)
✔ test /producer/<topicname> endpoint @done(20-03-06 15:34)
☐ add .env file and add it to config.py in /core
consumer:
datamodel:
☐ response model
☐ test response model
endpoint:
☐ add /consumer/<topicname> endpoint
☐ test /consumer/<topicname> endpoint
TIL
why do I need pykafka for aiokafka producer to connect?
It doesn't. The problem is that producer does not wait for Kafka to accept connections, so ConnectionError is thrown
on start-up. So by installing pykafka and restarting the producer-container I coincidally waited for kafka/zookeeper to
be up and running.
Looks like there is currently no way to mock aiokafka requests (see https://github.com/aio-libs/aiokafka/issues/561)
>> you can however mock the POST and the aiokafkaproducer send_and_wait()
When you try to write to a topic that doesn't yet exist,
both vanilla kafka-python and aiokafka silently create the topic before writing to it