<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sloth</title>
    <description>The latest articles on DEV Community by sloth (@sloth-os).</description>
    <link>https://dev.to/sloth-os</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4077403%2F380abc46-8e95-41cc-8362-6ef8afd3e9d1.png</url>
      <title>DEV Community: sloth</title>
      <link>https://dev.to/sloth-os</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sloth-os"/>
    <language>en</language>
    <item>
      <title>A pure-Go Kafka broker: protocol implementation, consumer groups, and transactional semantics</title>
      <dc:creator>sloth</dc:creator>
      <pubDate>Fri, 23 Oct 2026 07:30:53 +0000</pubDate>
      <link>https://dev.to/sloth-os/a-pure-go-kafka-broker-protocol-implementation-consumer-groups-and-transactional-semantics-954</link>
      <guid>https://dev.to/sloth-os/a-pure-go-kafka-broker-protocol-implementation-consumer-groups-and-transactional-semantics-954</guid>
      <description>&lt;p&gt;I’ve always found Kafka to be one of the most interesting distributed systems to study because the actual complexity is not in the “message bus” idea itself, but in the protocol semantics, state transitions, and client compatibility requirements underneath it.&lt;/p&gt;

&lt;p&gt;This repository stood out to me because it is a pure-Go Kafka broker that implements the Kafka wire protocol directly, rather than wrapping a JVM-based broker. It is a concrete implementation of many of the internals that Kafka clients normally hide behind a simpler API.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/sloth-os/kafka" rel="noopener noreferrer"&gt;https://github.com/sloth-os/kafka&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why this matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kafka is often treated as a black box: producers write, consumers read, groups coordinate, offsets commit, and the broker handles replication and retention. But the real engineering challenge is in the details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;request/response framing&lt;/li&gt;
&lt;li&gt;version negotiation&lt;/li&gt;
&lt;li&gt;flexible vs non-flexible protocol encoding&lt;/li&gt;
&lt;li&gt;message batch encoding and decoding&lt;/li&gt;
&lt;li&gt;consumer group state machines&lt;/li&gt;
&lt;li&gt;transactional producer semantics&lt;/li&gt;
&lt;li&gt;offset management and isolation behavior&lt;/li&gt;
&lt;li&gt;compatibility with external clients and protocol expectations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This repo implements a substantial subset of the Kafka protocol in Go and does so in a way that is explicit and inspectable. That makes it valuable not only as a broker implementation but as a reference for understanding Kafka internals.&lt;/p&gt;

&lt;p&gt;The project supports a broad range of Kafka APIs, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Produce / Fetch&lt;/li&gt;
&lt;li&gt;Metadata / ListOffsets&lt;/li&gt;
&lt;li&gt;OffsetCommit / OffsetFetch&lt;/li&gt;
&lt;li&gt;FindCoordinator / JoinGroup / Heartbeat / LeaveGroup / SyncGroup&lt;/li&gt;
&lt;li&gt;DescribeGroups / ListGroups&lt;/li&gt;
&lt;li&gt;ApiVersions&lt;/li&gt;
&lt;li&gt;CreateTopics / DeleteTopics / CreatePartitions&lt;/li&gt;
&lt;li&gt;InitProducerId / AddPartitionsToTxn / AddOffsetsToTxn / EndTxn / TxnOffsetCommit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a full in-memory consumer-group coordinator implementing the classic group state machine&lt;/li&gt;
&lt;li&gt;transactional produce flow support&lt;/li&gt;
&lt;li&gt;in-memory topic metadata and partition logs&lt;/li&gt;
&lt;li&gt;handling of both legacy and flexible protocol encodings&lt;/li&gt;
&lt;li&gt;compatibility with real Kafka clients&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The testing story is also important&lt;/p&gt;

&lt;p&gt;The project does not only rely on unit tests or mocks. It uses end-to-end tests against real Kafka client libraries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sarama&lt;/li&gt;
&lt;li&gt;kafka-go&lt;/li&gt;
&lt;li&gt;confluent-kafka-go&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is especially valuable in a protocol-heavy system like Kafka. A lot of correctness issues do not appear in isolated tests—they appear when real clients negotiate protocol versions, deserialize responses, and exercise edge cases under actual producer/consumer patterns.&lt;/p&gt;

&lt;p&gt;Running end-to-end tests against real client libraries gives much stronger confidence that the implementation matches real-world Kafka behavior, not just a simplified internal model.&lt;/p&gt;

</description>
      <category>kafka</category>
      <category>go</category>
      <category>testing</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Build One Bot, Reach Every Chat: A Universal WebSocket Bridge for IM Channels</title>
      <dc:creator>sloth</dc:creator>
      <pubDate>Wed, 19 Aug 2026 03:47:57 +0000</pubDate>
      <link>https://dev.to/sloth-os/build-one-bot-reach-every-chat-a-universal-websocket-bridge-for-im-channels-4jpm</link>
      <guid>https://dev.to/sloth-os/build-one-bot-reach-every-chat-a-universal-websocket-bridge-for-im-channels-4jpm</guid>
      <description>&lt;p&gt;Every chat platform reinvents the wheel. WeChat has its own API, Lark has another, Telegram another still — and if you're building a bot, an agent, or any service that needs to talk to people across IM channels, you end up writing and maintaining a separate integration for each one. The plumbing differs, the auth flows differ, the message formats differ, and every new channel means another chunk of bespoke code in your app.&lt;/p&gt;

&lt;p&gt;I got tired of that, so I built OpenClaw Bridge — a universal WebSocket bridge server that sits between your client and any number of IM backends. The idea is simple: your app speaks one protocol over a single WebSocket, and the bridge translates that into whatever each backend channel expects. Here's the shape of it:&lt;/p&gt;

&lt;p&gt;Client ──[WebSocket]──▶ Bridge Server ──[ChannelPlugin API]──▶ Backend Channels&lt;/p&gt;

&lt;p&gt;The key design decision is that the bridge contains zero plugin-specific code. It doesn't know how WeChat logs in, how Lark formats media, or how Telegram handles reply threading. Instead, it works with any channel that implements a standard ChannelPlugin interface. Install a plugin, drop its credentials into config.json, and it just works — WeChat, Lark, Telegram, Mattermost, IRC, QQ, WhatsApp, and whatever comes next.&lt;/p&gt;

&lt;p&gt;In this post I'll walk through why a bridge like this is worth building, how the envelope protocol keeps clients channel-agnostic, and how a subscription model lets multiple clients share one set of connected accounts without tripping over each other. If you've ever copy-pasted your fifth nearly-identical IM integration, this one's for you.&lt;/p&gt;

&lt;p&gt;For more information, visit &lt;a href="https://github.com/sloth-os/openclaw-bridge" rel="noopener noreferrer"&gt;https://github.com/sloth-os/openclaw-bridge&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>node</category>
    </item>
    <item>
      <title>mm-gateway: One Provider-Neutral API for Image, Video, and Music Generation</title>
      <dc:creator>sloth</dc:creator>
      <pubDate>Fri, 14 Aug 2026 09:32:30 +0000</pubDate>
      <link>https://dev.to/sloth-os/mm-gateway-one-provider-neutral-api-for-image-video-and-music-generation-2k5h</link>
      <guid>https://dev.to/sloth-os/mm-gateway-one-provider-neutral-api-for-image-video-and-music-generation-2k5h</guid>
      <description>&lt;p&gt;Every generative-AI app I worked on hit the same wall. Pick a backend — OpenAI for images, Volcengine for video, Mureka for music — and before long the app is &lt;em&gt;full&lt;/em&gt; of that provider's SDK quirks: its field names, its sync-vs-async polling loop, its error shapes. Then if want to swap one backend, or add a second one for failover, and it's a rewrite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/sloth-os/mm-gateway" rel="noopener noreferrer"&gt;mm-gateway&lt;/a&gt;&lt;/strong&gt; is an open-source Python gateway that sits in front of that mess. One provider-neutral contract — over &lt;strong&gt;13 backends&lt;/strong&gt;:&lt;br&gt;
   OpenAI · Google · xAI · DashScope · Volcengine · Flux · Stability · ElevenLabs · MiniMax · Mureka · ACE-Step · OpenRouter · UdioAPI&lt;/p&gt;

&lt;p&gt;The idea is simple: &lt;strong&gt;provider wire formats never appear in application code.&lt;/strong&gt; Every request goes through a strict, modality-specific envelope — an ordered list of &lt;em&gt;typed input parts&lt;/em&gt; plus &lt;em&gt;provider-neutral parameters&lt;/em&gt; — and each backend adapter translates that to its native SDK or REST shape.&lt;/p&gt;

&lt;p&gt;For more information, visit &lt;a href="https://github.com/sloth-os/mm-gateway" rel="noopener noreferrer"&gt;https://github.com/sloth-os/mm-gateway&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
