Files

1 line
2.8 KiB
JSON

{"text":["Kafka Wire Protocol","Hanzo Stream","A Kafka port in front of Hanzo PubSub","GitHub","Your clients, our store","01 / 06","It speaks Kafka","Produce, Fetch, ListOffsets, Metadata, OffsetCommit, OffsetFetch, FindCoordinator, JoinGroup, SyncGroup, Heartbeat, CreateTopics and ApiVersions, at the versions modern clients negotiate. kafka-python, sarama, confluent-kafka and franz-go all connect.","The log lives in PubSub","One topic partition is one durable PubSub stream. Retention, replicas and disk are that stream's settings, so the thing actually holding your events is a system you already run and already back up.","Nothing to operate","One Go binary that keeps no state of its own. Restart it, run several, roll it mid-deploy — the log is somewhere else, so the gateway is never the piece you are afraid to touch.","Offsets survive a restart","A group's committed offsets live in a PubSub key-value bucket, so a consumer that dies comes back where it left off instead of at the top. Ask for an offset that has aged out and you get OFFSET_OUT_OF_RANGE, so the client resets rather than hangs.","Offsets are stamped, not inferred","Every Kafka offset is written into the record batch header when the batch is produced, and read straight back from there. Deriving them from the store's own sequence numbers works right up until the sequence has gaps in it — and then one record can make every fetch after it unreadable.","Bad batches are refused on arrival","A produce whose batch chain does not line up is refused with INVALID_RECORD instead of being written and discovered later by a consumer that cannot get past it. The scan that recovers a partition's bounds is capped, so a damaged topic degrades rather than stalls.","Paste and ship","Paste this into any agent. It reads the skill manifest and calls Stream from there.","Agent prompt","Copy","Read https://hanzo.ai/skill.md and use Hanzo Stream in my project.","Kafka","Wire protocol","PubSub","Holds the log","Stateless","No broker disk","Durable","At-least-once","One line changes: the bootstrap server","producer.py","import","json","from","kafka","KafkaProducer","KafkaConsumer","# The only line that changes","producer = KafkaProducer","bootstrap_servers=","stream.hanzo.ai:9092","],","value_serializer=","lambda","dumps",").","encode","(),","producer","send","events","type","user.signup","user_id","usr_123","})","# Consumer groups work identically","consumer = KafkaConsumer","group_id=","my-service","auto_offset_reset=","earliest","for","message","in","consumer","process","value","Point the bootstrap server at it","The clients stay as they are. The cluster underneath them goes away.","View on GitHub","Get Stream","Event stream","Apache-2.0","License:","hanzoai/stream","4 stars","Deploy to Cloud","02 / 06","03 / 06","04 / 06","05 / 06","06 / 06"],"links":["https://github.com/hanzoai/stream","https://platform.hanzo.ai/deploy"]}