{"repo":"wangzihaogithub/spring-boot-protocol","free":true,"listed":false,"github":"https://github.com/wangzihaogithub/spring-boot-protocol","clone":"git clone https://github.com/wangzihaogithub/spring-boot-protocol.git","description":"springboot功能扩充-netty动态协议，可以支持各种网络协议的动态切换（单端口支持多个网络协议）.支持mmap，sendfile零拷贝，http请求批量聚合","language":"Java","stars":130,"topics":["spring-boot","protocol","rpc","mqtt","servlet","springcloud","springservlet","spring-boot-protocol","netty"],"license":"Apache-2.0","category":"api-integrations-sdks","readme_excerpt":"Spring-boot-protocol (用Netty实现) 简介 - 支持在一个端口号上，添加多个TCP协议，支持加自定义TCP协议 - 内置实现有: Dubbo-proxy, HttpServlet, RPC, MQTT, Websocket, H2, MYSQL协议. - 解决Netty在EventLoop线程里写繁忙后不返回数据的BUG. - 解决Netty的Http遇到请求参数携带%号会报错的问题. - 从19年开始，一直跑在作者公司某产线的线上环境运行. 优势 - 1.针对spring项目# 可以替代tomcat或jetty. 导包后一个@EnableNettyEmbedded注解即用. - 2.针对非spring项目# 本项目可以只依赖一个netty（举个使用servlet的例子） StartupServer server = new StartupServer(80); ServletContext servletContext = new ServletContext(); servletContext.setDocBase(\"D://static\", \"/webapp\"); servletContext.addServlet(\"myServlet\", new MyHttpServlet()).addMapping(\"/test\"); server.addProtocol(new HttpServletProtocol(servletContext)); server.start(); - 3.支持# tcp dubbo代理, 解决内外网运维问题 [DubboProxy{/192.168.11.126:61184 = [pay-service//127.0.0.1:20881(UP), order-service//127.0.0.1:20881(UP)]}] server: port: 8080 netty: dubbo: enabled: true routes: - path-patterns: 'com.github.netty.javadubbo.example. ' address: '127.0.0.1:8002' - application-name: 'order-service' address: '127.0.0.1:8002' - application-name: 'pay-service' address: '127.0.0.1:8003' default-application: true - 4.支持# http请求聚合, 然后用 select from id in (httpRequestList). 示例代码：com.github.netty.http.example.HttpGroupByApiController.java - 5.支持# h2c (注: 不建议用h2,h2c当rpc, 原因在文档最底部有说明) - 6.支持# 异步零拷贝。sendFile, mmap. 示例代码：com.github.netty.http.example.HttpZeroCopyController.java ((NettyOutputStream)servletResponse.getOutputStream()).write(new File(\"c://123.txt\")); ((NettyOutputStream)servletResponse.getOutputStream()).write(M","default_branch":null,"files":null,"tree":[],"storefront":"/r/wangzihaogithub","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/wangzihaogithub/spring-boot-protocol/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}