# FreddyChen/NettyChat

基于Netty+TCP+Protobuf实现的Android IM库，包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。

Repository: https://github.com/FreddyChen/NettyChat
Canonical: https://ross.abutalabs.com/products/nettychat
Homepage: https://juejin.im/post/5c97ae12e51d45580b681b0b
Language: Java
License: Apache-2.0
License Family: permissive
Topics: im, netty, tcp, chat, socket, protobuf, nio, aio, bio, heartbeat, offline-message, reconnect-socket
Last push: 2020-09-03T10:03:55+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2703, "days_push": 2190, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2327, forks 567 (observed 2026-08-28T04:06:37.505977+00:00)

## What it is
An Android instant messaging (IM) client library built on Netty, TCP, and Protobuf. It provides a complete long-connection messaging stack including Protobuf serialization, TCP packet splitting/sticky-packet handling, handshake authentication, heartbeat, reconnection, message resending, read/write timeouts, offline messages, and thread pooling.

## Use cases
- add chat messaging to an Android app
- implement a reliable TCP long connection on Android
- send and receive protobuf messages over a persistent socket
- handle heartbeat and automatic reconnection for mobile IM
- deliver offline messages when users reconnect
- learn how Netty-based IM clients handle sticky packets and handshakes

## When to choose
- you need a self-hosted, protocol-level IM client on Android with full control over the wire protocol
- you want TCP reliability with protobuf efficiency for high-volume messaging
- you want a learning reference for building Netty-based Android IM systems

## When to avoid
- you need a turnkey chat backend with accounts, groups, and push - this is a client-side transport library only
- you prefer WebSocket or MQTT-based messaging instead of raw TCP
- you need an actively maintained library with recent releases (last release 2020)
- your project is not on the JVM/Android

## Facets
- artifact type: library
- maturity: maintenance
- function: serialization, networking, concurrency, middleware
- domain: messaging-platforms, mobile-development, android-tools, developer-tools
- platform: jvm
- tags: im, instant-messaging, netty, tcp, protobuf, heartbeat, reconnection, offline-messages, long-connection, chat, real-time, android, mobile

## Member repositories
- FreddyChen/NettyChat (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:37.505977+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:38:13.637828+00:00, confidence not recorded.
  - readme: https://github.com/FreddyChen/NettyChat (fetched 2026-08-28T04:06:37.505977+00:00, sha ecd15cb01451)
  - homepage: https://juejin.im/post/5c97ae12e51d45580b681b0b (fetched 2026-08-29T10:18:35.612434+00:00, sha eec42e6db6d2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
