Reactor-Guice基于 Reactor 的 Guice 框架
Reactor-Guice 是一个基于 Reactor 的 Guice 框架,集成了 Google Guice 和 Reactor-netty 框架。
通过 Maven 引入后,简单的代码就可以启动你的 http 和 websocket 服务
并搭建你的微服务
https://github.com/koocyton/reactor-guice-example 是一个实例
Reactor-Guice 聚焦于以下功能
1. 通过 JAX-RS 注解注入来完成 Route 配置
2. 通过 @Products 来指定返回的类型
3. 通过继承 AbstractWebSocketServerHandle 获得 Websocket 服务路径
4. 实现 KReactorFilter 对访问路径过滤
以下是含 数据库 和 Redis 功能的配置
Injector injector = Guice.createInjector( // application Properties binder -> Names.bindProperties(binder, properties), // mybatis new MyBatisModule() { @Override protected void initialize() { install(JdbcHelper.MySQL); bindDataSourceProviderType(HikariDataSourceProvider.class); bindTransactionFactoryType(JdbcTransactionFactory.class); addMapperClasses("com.doopp.gauss.app.dao.mapper"); addInterceptorClass(PageInterceptor.class); } }, // redis new RedisModule(), // application new ApplicationModule() );
KReactorServer.create() .bind(host, port) .injector(injector) .handlePackages("com.doopp.gauss.app.handle.v1") .addFilter("/", AppFilter.class) .launch();
评论
Gutty基于 Google Guice 和 Netty 的网络框架
简介一直很喜欢轻量IOC框架 Guice,希望能将其和netty整合起来网上有不少整合的例子,但没有整合成扫描包后,自动完成路由和模块配置,这是最好用的功能之前将Reactor-Netty和Guice
Gutty基于 Google Guice 和 Netty 的网络框架
0
Gutty基于 Google Guice 和 Netty 的网络框架
简介一直很喜欢轻量 IOC 框架 Guice ,希望能将其和 netty 整合起来网上有不少整合的例
Gutty基于 Google Guice 和 Netty 的网络框架
0
RoboGuiceAndroid上的Guice
在开发应用时一个基本原则是模块化,并且近最大可能性地降低模块之间的耦合性。在Java平台上SpringFramework以及.Net平台CAB,SCSF和Prism(WPF,Silverlight)中
RoboGuiceAndroid上的Guice
0
wgf基于Golang的框架
文档(Documentation)中文EnglishWgf是什么?Hello,wgf是基于Golang的的编程框架。目标为提供一个尽可能统一的编程环境,提高工作效率。目前,wgf已完成对http、cl
wgf基于Golang的框架
0