https://github.com/d-led/zeromq-pubsub-example
https://github.com/d-led/zeromq-pubsub-example
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/d-led/zeromq-pubsub-example
- Owner: d-led
- License: unlicense
- Created: 2022-03-28T20:27:44.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-08T11:42:06.000Z (about 4 years ago)
- Last Synced: 2025-02-15T23:44:23.295Z (over 1 year ago)
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zeromq-pubsub-example
see the demo output: [](https://github.com/d-led/zeromq-pubsub-example/actions/workflows/docker-demo.yml)
## Running
in separate consoles:
- in `go-publisher`: `go run .`
- on Windows: install the dependencies as described below, and then `..\scripts\go_build.bat`
to build. Then, run `..\scripts\go_run.bat` to launch the compiled program.
- in `go-subscriber`: `go run .` (more than one can be started)
- on Windows: same as for `go-publisher`
- alternatively, start the python publisher in `py-publisher`:
- install the dependencies: `pip3 install -r requirements.txt`
- run: `python3 main.py`
### In Docker
```bash
docker-compose up --build --force-recreate
```
### Demo on Windows
- install the dependencies as described below
- run `demo.bat`, which starts two subscribers in the background
and the python publisher in the foreground
## Dependencies
### OSX
- `brew install zeromq libsodium czmq`
### Windows
- install [vcpkg](https://github.com/microsoft/vcpkg#quick-start-windows)
- set the environment variable `VCPKG_ROOT` to the bootstrapped vcpkg location
- add the `VCPKG_ROOT` location to `PATH`
- install MinGW: `choco install /y mingw`
- [install](https://github.com/zeromq/goczmq/issues/229#issuecomment-1019070347) czmq: `vcpkg install --triplet=x64-windows czmq`
- rename `%VCPKG_ROOT%\installed\x64-windows\lib\libzmq-mt-4_3_4.lib` to `...\libzmq.lib` for CGO to find it
- install libsodium: `vcpkg install --triplet=x64-windows libsodium`