Asity 2.0.0-Alpha1 released
flowersinthesand 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:
- Set minimum Java version to 8
- Allow to read WebSocket handshake request headers
- Support Spring WebFlux 5
- Support Spring Web MVC 4
- Support Vert.x 3
For the details of the progress and information, visit https://github.com/cettia/asity. 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
@SpringBootApplication
@EnableWebFlux
public class Application {
@Bean
public Server server(HttpTransportServer httpTransportServer, WebSocketTransportServer wsTransportServer) {
Server server = new DefaultServer();
httpTransportServer.ontransport(server);
wsTransportServer.ontransport(server);
return server;
}
@Bean
public HttpTransportServer httpTransportServer() {
return new HttpTransportServer();
}
@Bean
public WebSocketTransportServer wsTransportServer() {
return new WebSocketTransportServer();
}
@Bean
public RouterFunction<ServerResponse> httpMapping(HttpTransportServer httpTransportServer) {
AsityHandlerFunction asityHandlerFunction = new AsityHandlerFunction().onhttp(httpTransportServer);
return RouterFunctions.route(
path("/cettia")
// Excludes WebSocket handshake requests
.and(headers(headers -> !"websocket".equalsIgnoreCase(headers.asHttpHeaders().getUpgrade()))), asityHandlerFunction);
}
@Bean
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();
mapping.setUrlMap(map);
return mapping;
}
@Bean
public WebSocketHandlerAdapter webSocketHandlerAdapter() {
return new WebSocketHandlerAdapter();
}
@Bean
public CorsWebFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.applyPermitDefaultValues();
config.setAllowCredentials(true);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/cettia", config);
return new CorsWebFilter(source);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
All posts
- Asity 3.0.0 released on
- Asity 3.0.0-Beta1 released on
- Cettia JavaScript Client 1.1.0 released on
- Cettia JavaScript Client 1.0.2 released on
- New Cettia Starter Kit on
- Cettia Java Server 1.2.0 released on
- Cettia Java Server 1.2.0-Beta2 released on
- Cettia Java Server 1.1.0 released on
- Cettia Java Server 1.1.0-Beta1 released on
- Asity 2.0.0 released on
- Asity 2.0.0-RC1 released on
- Asity 2.0.0-Alpha2 released on
- Asity 2.0.0-Alpha1 released on
- Cettia JavaScript Client 1.0.1 released on
- Cettia 1.0.0 released on
- Cettia 1.0.0-RC1 released on
- Cettia JavaScript Client 1.0.0-Beta2 released on
- Cettia 1.0.0-Beta1 released on
- Cettia Java Platform is now Asity on
- Cettia 1.0.0-Alpha2 released on
- Cettia 1.0.0-Alpha1 released on