Skip to content

Streaming realtime data via websocket by Go, Grpc

Notifications You must be signed in to change notification settings

chunvv/notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notifier - A server to streaming realtime data with Golang and gRPC

Why?

  • Want to build a server to stream realtime data via Websocket with Golang!

What?

  • Realtime twitter data by topic via websocket
  • Technologies:
    • Languages: Server: Golang
    • Proto: gPRC, websocket

How?

  • Backend side by Java will use Kafka to connect to Twitter API to fetch realtime data by reigistering topics
  • Java side will send data via gRPC via stub to gRPC server(Golang)
  • Server side(Golang) will distribute the twitter data to client via websocket proto
  • Java backend side: https://github.com/chariot9/twitter-kafka-streaming

Architecture:

architecture

Setup

  1. Add git sub-module
$ git submodule add https://github.com/chariot9/proto-notifier.git proto
  1. Compile proto files
$ protoc -I proto/ proto/notifier/src/twitter/*.proto --go_out=plugins=grpc:grpc
protoc -I/usr/local/include -I. \
  -I$GOPATH/src \
  -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
  --grpc-gateway_out=logtostderr=true:../ \
  notifier/src/twitter/*.proto

Run

  1. Start the gateway:
$ go run gateway/cmd/main.go
  1. Start the Grpc server:
$ go run cmd/main.go

About

Streaming realtime data via websocket by Go, Grpc

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages