protocol-ezmq-go is a go package which provides a standard messaging interface over various data streaming
and serialization / deserialization middlewares along with some added functionalities.
- Currently supports streaming using 0mq and serialization / deserialization using protobuf.
- Publisher -> Multiple Subscribers broadcasting.
- Topic based subscription and data routing at source (read publisher).
- High speed serialization and deserialization.
-
You must install basic prerequisites for build
- Make sure that libtool, pkg-config, build-essential, autoconf, and automake are installed.
$ sudo apt-get install libtool pkg-config build-essential autoconf automake
- Make sure that libtool, pkg-config, build-essential, autoconf, and automake are installed.
-
Python
- Version : 2.4 to 3.0
- How to install
-
SCons
- Version : 2.3.0 or above
- How to install
-
Go compiler
- Version : 1.9
- How to install
-
You must install libsodium: [It is required for secured mode]
$ sudo apt-get install libsodium-dev
- Goto: ~/protocol-ezmq-go/
- Run the script:
./build_auto.sh <options>
Notes:
(a) For getting help about script option: $ ./build_auto.sh --help
(b) Currently, Script needs sudo permission for installing zeroMQ and protobuf libraries. In future need for sudo will be removed by installing those libraries in ezmq library.
(c) While doing cross compilation, permission denied error may come.
For example: The below error while building for armhf:
go install runtime/internal/sys: mkdir /usr/local/go/pkg/linux_arm: permission denied
Do the following:
- sudo mkdir /usr/local/go/pkg/linux_arm/
- sudo chmod 777 /usr/local/go/pkg/linux_arm/
Built ezmq library
- Goto: ~/${GOPATH}/src/go/samples/
- Run the sample:
./subscriber_secured
- It will give list of options for running the sample.
- Update ip, port and topic as per requirement.
- With secured sample unsecured features can be tested
- It will give list of options for running the sample.
- Goto: ~/${GOPATH}/src/go/samples/
- Run the sample:
./publisher_secured
- It will give list of options for running the sample.
- Update port and topic as per requirement.
- With secured sample unsecured features can be tested
- It will give list of options for running the sample.
- Goto: ~/${GOPATH}/src/go/samples/
- Run the sample:
./subscriber
- It will give list of options for running the sample.
- Update ip, port and topic as per requirement.
- This sample will be built, only if ezmq package is built in unsecured mode.
- It will give list of options for running the sample.
- Goto: ~/${GOPATH}/src/go/samples/
- Run the sample:
./publisher
- It will give list of options for running the sample.
- Update port and topic as per requirement.
- This sample will be built, only if ezmq package is built in unsecured mode.
- It will give list of options for running the sample.
Built ezmq package.
- Goto:
~/protocol-ezmq-go/src/go/unittests
- Run the script
$ build.sh
- Goto
~/protocol-ezmq-go/src/go/unittests
- Run the script
$ build.sh
- Run the below command to open coverage report in web browser:
$ go tool cover -html=coverage.out
- The microservice which wants to use ezmq GO library has to import ezmq package:
import go/ezmq
- Reference ezmq library APIs : doc/godoc/ezmq.html
- Goto: ~/${GOPATH}/src/go/
- Run the below command:
$ go tool vet -all .
- High speed parallel ordered serialization / deserialization based on streaming load.
- Threadpool for multi-subscriber handling.
- Router pattern. For number of subscribers to single publisher use case.
- Clustering Support.