https://github.com/byakkili/b-im
B-IM是基于Netty实现的即时通讯框架
https://github.com/byakkili/b-im
b-im hutool im java netty protobuf spring-boot-starter
Last synced: 5 months ago
JSON representation
B-IM是基于Netty实现的即时通讯框架
- Host: GitHub
- URL: https://github.com/byakkili/b-im
- Owner: byakkili
- License: apache-2.0
- Created: 2020-05-22T21:08:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T21:42:34.000Z (over 3 years ago)
- Last Synced: 2025-08-03T00:09:34.349Z (11 months ago)
- Topics: b-im, hutool, im, java, netty, protobuf, spring-boot-starter
- Language: Java
- Homepage:
- Size: 211 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
-------------------------------------------------------------------------------
## B-IM 简介
B-IM是用JAVA语言,基于Netty实现的轻量级、高性能的IM即时通讯框架,主要是降低相关API的学习成本,降低即时通讯门槛,提高工作效率,让开发者更专注于业务的开发。
## 主要特色
1、高性能(可支持几十万以上用户同时在线)
2、轻量,拓展性高(提供丰富的API: 会话监听器、命令拦截器、自定义命令、自定义协议...)
3、支持集群部署(默认提供redisson实现)
4、可支持JSON、Protobuf消息格式(默认提供实现,可根据需要自行拓展)
-------------------------------------------------------------------------------
## 包含模块
| 模块 | 介绍 |
|-------------------------|-------------------------------------------------|
| bim-core | 核心包 |
| bim-spring-boot-starter | SpringBoot启动器,让配置更简单 |
-------------------------------------------------------------------------------
## 文档
[参考API](https://apidoc.gitee.com/byakkili/B-IM)
-------------------------------------------------------------------------------
## 安装
### Maven
在项目中的pom.xml的dependencies中加入以下内容:
```xml
com.github.byakkili
bim-core
0.0.3
```
### Gradle
```
compile 'com.github.byakkili:bim-core:0.0.3'
```
### 非Maven项目
点击以下任一链接,下载`bim-core-0.0.3.jar`即可:
- [Maven中央库1](https://repo1.maven.org/maven2/com/github/byakkili/bim-core/0.0.3/)
- [Maven中央库2](http://repo2.maven.org/maven2/com/github/byakkili/bim-core/0.0.3/)
-------------------------------------------------------------------------------
## 使用
###### (可参考src/test/java下的demo)
```java
public class ServerStarter {
public static void main(String[] args) {
BimConfiguration config = new BimConfiguration();
config.setPort(9000); // 端口
config.setReaderTimeout(30); // 读超时30秒
config.setWriterTimeout(30); // 写超时30秒
// 添加协议提供者
config.addProtocolProvider(new WsProtobufProtocolProvider());
config.addProtocolProvider(new TcpProtobufProtocolProvider());
config.addCmdHandler(new TestHandler()); // 添加命令处理器
config.addCmdInterceptor(new TestInterceptor()); // 添加命令拦截器
config.addSessionListener(new TestSessionListener()); // 设置会话监听器
BimNettyServer bimNettyServer = new BimNettyServer(config);
bimNettyServer.start(); // 启动
bimNettyServer.close(); // 关闭
}
}
```
## DEMO
1、下载本工程代码
2、进入目录B-IM\bim-spring-boot-starter\src\test\resources, 修改配置文件application.yml、redisson.yml
3、运行B-IM\bim-spring-boot-starter\src\test\java\com\github\byakkili\bim\demo\JsonApplication.java的main方法
4、双击打开B-IM\bim-spring-boot-starter\src\test\resources\index.html即可(可打开多个窗口进行聊天)