스트림 프로세싱 with Faust - kafka consumer/producer
2019. 11. 21.
Faust는 python기반 스트림프로세싱을 위한 library입니다. 아래 코드는 kafka로부터 데이터를 가지고 오는 code입니다. Producer from dataclasses import asdict, dataclass import json import faust # 모듈 import @dataclass # 데이터 직렬화를 위한 json dataclass 선언 for faust class ClickEventSanitized(faust.Record): timestamp: str uri: str number: int app = faust.App("exercise3", broker="kafka://localhost:9092") # 카프카 브로커 clickevents_topic = app.topic("..