Giter VIP home page Giter VIP logo

linbox_server's Introduction

linbox_server

LINBOX is a distributed IM system designed for www.medtree.cn.

Download medtree app for iphone at here

Download medtree app for android at here

Tech

  • Netty and tcp protocol
  • Kafka as center MQ
  • Dubbo as rpc framework
  • Zookeeper as config center

Usage

Build the project:

gradle zip

distribution package is under

build/distribution/linbox_server-1.0.zip

Unzip it and start the server:

# start the tcp client:
sh tcpServer.sh

# start the router:
sh consumer.sh

# start the rpc client
sh rpcServer.sh

High availablity and scaliability

Linbox is distributed by design. All of the components of linbox - tcp client, rpc client and router - are all distributed.

Steps to prompt availability:

  • Use zookeeper cluster
  • Use Kafka cluster
  • Use tcp client cluster
  • Use rpc client cluster
    • rpc.xml need to be configured for pointed rpc port, or you can use dynamic ports generated by system.
  • Use router client cluster

Dependencies

Java Version

JDK-1.8 is required to build and run it.

Security Update For JRE

Be carefual: as we use AES-256 encryption, you need to download packages to update your local jre environment.

  • Download package at here
  • Unzip and copy the jars into ${java.home}/jre/lib/security/

Click this for detail information for this problem.

Mysql

Mysql database is used as persistence storage for im messages.

Mysql Versions

There is no special requirement for mysql version. But if you want to use emojis, you need to use mysql version 5.6+, and config the character set to utf8mb4.

Predefined Tables

You can find all mysql operations in package com.linbox.im.server.storage

There are 4 tables predefined in programs, sql script could be find in mysql.sql

Configs

Config mysql connection in im.properties

Redis

Config redis connection in im.properties

Zookeeper

Zookeeper is used as config center of the project. It is also a dependency of dubbo and Kafka. Config Zookeeper in rpc.xml

Kafka

Kafka is used as Center MQ. Kafka is configd in im.properties

Architecture

architecture

Communication Protocol

Linbox use tcp protocal and JSON structure in communication. Data package structure is designed as below:

Version Type Length Content
2 Byte 2 Byte 4 Byte JSON String
Name Description
Version A flag to show the protocol version of the package
Type Request / Response command type
Length The length of the content part
Content Encrypted Data content structured in json

Main Communications

Get history messages

im-pulloldmessage

Get unread count and messages

im-syncunread

Send messages

Im-Communication

linbox_server's People

Contributors

lrsec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

linbox_server'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.