Asity 2.0.0-Alpha1 released

wrote this on

I’m happy to announce the availability of the first alpha release of Asity 2.0.0. First of all, we rephrased the project definition to make clear the identity of the project:

Asity is an abstraction layer for various web frameworks on the Java Virtual Machine.

This articulates the reason why we created the Asity project; Cettia works with any web framework on the JVM, and allows the end user to plug in the desired web framework. Here’s a roadmap for Astiy 2:

For the details of the progress and information, visit Asity 2 will be available early July. If you have any idea or proposal, don’t hesitate to let us know on Cettia Groups!

As for the first alpha release, it includes support for Spring WebFlux, a web framework of Spring’s reactive stack based on Reactive Streams. With io.cettia.asity:asity-bridge-spring-webflux5:2.0.0-Alpha1 bridge module, you can build a Cettia application with Spring WebFlux, and run it through Spring Boot just like a plain Spring application. Here’s an example:

package io.cettia.example.spring;

import io.cettia.asity.bridge.spring.webflux5.AsityHandlerFunction;
import io.cettia.asity.bridge.spring.webflux5.AsityWebSocketHandler;

// Skipped for brevity

public class Application {

  public Server server(HttpTransportServer httpTransportServer, WebSocketTransportServer wsTransportServer) {
    Server server = new DefaultServer();
    return server;

  public HttpTransportServer httpTransportServer() {
    return new HttpTransportServer();

  public WebSocketTransportServer wsTransportServer() {
    return new WebSocketTransportServer();

  public RouterFunction<ServerResponse> httpMapping(HttpTransportServer httpTransportServer) {
    AsityHandlerFunction asityHandlerFunction = new AsityHandlerFunction().onhttp(httpTransportServer);

    return RouterFunctions.route(
        // Excludes WebSocket handshake requests
        .and(headers(headers -> !"websocket".equalsIgnoreCase(headers.asHttpHeaders().getUpgrade()))), asityHandlerFunction);

  public HandlerMapping wsMapping(WebSocketTransportServer wsTransportServer) {
    AsityWebSocketHandler asityWebSocketHandler = new AsityWebSocketHandler().onwebsocket(wsTransportServer);
    Map<String, WebSocketHandler> map = new LinkedHashMap<>();
    map.put("/cettia", asityWebSocketHandler);

    SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();

    return mapping;

  public WebSocketHandlerAdapter webSocketHandlerAdapter() {
    return new WebSocketHandlerAdapter();

  public CorsWebFilter corsFilter() {
    CorsConfiguration config = new CorsConfiguration();

    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    source.registerCorsConfiguration("/cettia", config);

    return new CorsWebFilter(source);

  public static void main(String[] args) {, args);