GithubHelp home page GithubHelp logo

im's Introduction

https://github.com/smallFive55/im

https://gitee.com/zjz0812/heart-netty

IM聊天室

一个基于Netty的聊天工具(开发中),使用Zookeeper+Redis实现服务端分布式部署。

系统架构

image

  • 客户端服务端的连接,通过路由端选择可用服务端节点
  • 服务端启动后,向Zookeeper注册自己
  • 客户端发送消息通过路由端,选择对应的服务端进行推送消息
  • 路由端无状态,集群部署只需要一个Nginx代理即可

TODO LIST

  • 客户端服务端连接
  • 客户端处理用户输入消息
  • 消息序列化(Protobuf)
  • 服务端注册
  • 路由端获取可用服务端节点
  • 消息群发功能
  • 客户端下线(强制下线/主动下线)
  • 服务端断线,客户端重连
  • 心跳
  • 消息重发
  • 聊天记录
  • 离线消息

运行

1.启动redis与Zookeeper,修改redis、Zookeeper配置

2.编译、打包

mvn -Dmaven.test.skip=true clean package

3.启动路由

java -jar im-route\target\im-route-0.0.1-SNAPSHOT.jar

4.启动服务端

java -jar im-server\target\im-server-0.0.1-SNAPSHOT.jar --server.port=8084 --im.server.port=8090
java -jar im-server\target\im-server-0.0.1-SNAPSHOT.jar --server.port=8085 --im.server.port=8091

5.启动客户端

java -jar im-client\target\im-client-0.0.1-SNAPSHOT.jar --server.port=8071 --im.user.id=1001 --im.user.userName=Five
java -jar im-client\target\im-client-0.0.1-SNAPSHOT.jar --server.port=8072 --im.user.id=1002 --im.user.userName=Luffy

6、生成protoc protoc --js_out=import_style=commonjs,binary:. testmessage.proto protoc --java_out=./ ./dto_message.proto

protoc --js_out=import_style=commonjs,binary:. MessageProto.proto

protoc --java_out=./ ./MessageProto.proto

im's People

Contributors

smallfive55 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.