Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Support Kotlin Serialization for Netty Packets #24

@twisti-dev

Description

@twisti-dev

Is your feature request related to a problem?

Yes. Currently, Netty packets require custom or manual serialization mechanisms, which can become repetitive and error-prone. This limitation makes it harder to leverage modern Kotlin features and libraries, especially in projects that already use Kotlin serialization extensively for data handling.

Describe the solution you'd like.

Enable support for writing and serializing Netty packets using Kotlin serialization. Ideally, this would involve:

  • Defining packet data classes with @Serializable
  • Utilizing kotlinx.serialization to encode/decode packets to ByteBuf
  • Seamless integration into the existing Netty pipeline for reading/writing these packets

This approach should work without significantly modifying Netty internals and should be configurable or pluggable.

Describe alternatives you've considered.

  • Manually implementing serialization/deserialization using ByteBuf (tedious and error-prone)
  • Using other libraries like Jackson or Protobuf (adds complexity and breaks uniformity in a Kotlin-centric codebase)
  • Writing a custom abstraction layer (duplicating features already available in kotlinx.serialization)

Other

This would make packet serialization much more idiomatic for Kotlin developers and streamline networking logic in Kotlin-based Netty projects. Could also open doors for multiplatform-friendly packet systems.

Metadata

Metadata

Assignees

Labels

status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions