Skip to content

Releases: Anubis-IV/classy-socket

Classy Socket v0.1.0-alpha.1

Pre-release

Choose a tag to compare

@mahmoudxbaz mahmoudxbaz released this 26 Aug 21:23

Classy Socket v0.1.0-alpha.1

The first public release of Classy Socket, a Spring Boot library that provides a simple, annotation-driven programming model for building WebSocket applications.

Features

  • Annotation-based WebSocket controllers with @WebSocketController
  • Message type mapping with @WebSocketMessage
  • Message handler methods using @MessageHandler
  • Connection lifecycle callbacks with @OnConnect and @OnDisconnect
  • Automatic message deserialization using Jackson
  • Handler method argument resolution
  • WebSocket session management through a session registry
  • Messaging support through a messaging hub
  • Centralized message routing
  • Spring Boot starter for easy integration
  • Configurable WebSocket path and allowed origins
  • Support for multiple WebSocket controllers and message types

Modules

This release contains:

  • classy-socket — the core WebSocket framework
  • classy-socket-spring-boot-starter — Spring Boot integration and auto-configuration
  • classy-socket-example — example application demonstrating library usage

Example

A WebSocket endpoint can be defined using annotations:

@WebSocketController("/kanban")
public class KanbanController {

    @OnConnect
    public void onConnect(Session session) {
        // Handle connection
    }

    @MessageHandler(CreateTaskMessage.class)
    public void createTask(CreateTaskMessage message, Session session) {
        // Handle message
    }

    @OnDisconnect
    public void onDisconnect(Session session) {
        // Handle disconnection
    }
}

Clients communicate with the application using typed WebSocket messages rather than manually implementing message routing.

Requirements

  • Java 17+
  • Spring Boot 4.1+

Installation

Add the Spring Boot starter to your project:

<dependency>
    <groupId>io.github.anubis-iv</groupId>
    <artifactId>classy-socket-spring-boot-starter</artifactId>
    <version>0.1.0-alpha.1</version>
</dependency>

Documentation

See the project README and example application for configuration and usage details.

Status

This is the first public release of Classy Socket. The API may evolve in future releases as the project develops.