Coder Social home page Coder Social logo

newim's Introduction

NewIM

This is a simple NewIM, created for Mobile App. by using Netty + WebSocket, Zookeeper, Redis and Protobuf.

Gateway

this node receives connections from Mobile and holds them, receives message from Mobile and then deliver the message to Chat Node. It uses zookeeper to store connection info.

Chat

this node routes message to all those mobile client in P2P, P2G way. it uses Zookeeper to get connections on Gateway node.

Zookeeper

it is a No 1 component in NewIM. it can deliver updates to clients in less than a second and support HA. so it is a Keeper.

Redis

this is where message save when Gateway got those messages.

Protobuf Definition

App talks to Gateway with Protobuf, Gateway sends messages to App with Protobuf. Gateway talks to Chat Node with Protobuf.

message ChatMessage {
  required string boxid = 1;
  required int32 group = 2 [default = 0];
  optional string uuid = 3;
  optional string sender = 4;
  optional string receiver = 5;
  optional string body = 6;
  enum MessageType {
      SmallText = 0;
      LongText = 1;
      AUDIO = 2;
      IMAGE = 3;
      VIDEO = 4;
      FILE = 5;
      LINK = 6;
      SYNC = 7;
  }
  required MessageType mtype = 7 [default = SYNC];

  enum ChatOp {
      JOIN = 0;
      QUIT = 1;
      CHAT = 2;
      ACK = 3;
  }
  required ChatOp op = 8 [default = ACK];
}

message ChatStatus {
  required string sender = 1;
  required int32 syncMark = 2;
}

message ExchangeMessage {
  required string messageId = 1;
  optional string message = 2;
  optional string chatPath = 3;
  optional string chatRoomId = 4;
  optional string msgPath = 5;
  repeated int32 channelId = 6;
}

TODO

  1. receive image, audio, video file from clients
  2. support node monitor

newim's People

Contributors

yamingd avatar

Stargazers

三余无梦生 avatar Shawyer Peng avatar  avatar  avatar  avatar uzkitio avatar  avatar chenht avatar  avatar Qin Likang avatar asktalk avatar 龙哥 avatar cl avatar justinqiu avatar  avatar krisjin avatar  avatar jakyou avatar Sagar Ipte avatar

Watchers

 avatar James Cloos avatar Bin Wang avatar Qin Likang avatar  avatar  avatar  avatar  avatar

newim's Issues

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.