jsaul / httpmsgbus

httpmsgbus is a general-purpose HTTP-based message bus.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

httpmsgbus (HMB) can be used as a standalone program or as an add-on to
SeisComP [1]; the code can be copied to SeisComP source tree and compiled
together with the rest of the SeisComP using CMake or installed separately using
the install.sh script. Go compiler (<1.16) [2] is required to compile the code.
Go 1.16 and newer are currently not supported due to incompatibilities of the
module system.

Libpcre (pcre-devel, libpcre3-dev or similar Linux package) is also
required, unless the "vendor" directory is removed to link with standard Go
regexp package. Using the standard Go regexp package creates a portable
binary, but there seems to be a memory leak (ever growing cache) in some
Go versions.

In SeisComP, HMB is disabled by default and can be enabled by adding the
following options to ~/seiscomp/etc/kernel.cfg:

hmb.enable = true
hmb.port = 8000

The distribution includes an alternative Seedlink implementation consisting
of "hmbseedlink" and "wavefeed" modules, which can used as a drop-in
replacement for the standard "seedlink" module. Normal seedlink bindings
are used, but only chain sources are supported.

There are two simple demo scripts, send_json.py and receive_json.py, in
doc/examples/python directory. Start httpmsgbus without arguments and call
"python send_json.py notice 'something happened'" in another shell. The bus
http://localhost:8000/test and the queue SYSTEM_ALERT will be created
dynamically. Now start "python receive_json.py" in third shell window. You
can observe that messages sent by send.py will be received by receive.py.

BSON counterpars of the scripts, send_bson.py and receive_bson.py require
the "python-pymongo" package to be installed.

You may also test persistent storage by using the option "-D filedb://filedb"
of httpmsgbus. The folder "filedb" will be created in the current directory
(use filedb:/// for absolute path).

If you are running MongoDB, try "-D mongodb://localhost:27017".

HMB does not implement SSL, HTTP compression and authentication. Those
features can be provided by a reverse proxy (eg., Apache with mod_proxy).

[1] https://www.seiscomp.de/
[2] https://golang.org/dl/

About

httpmsgbus is a general-purpose HTTP-based message bus.


Languages

Language:Go 75.4%Language:C++ 13.2%Language:Python 7.6%Language:CMake 3.3%Language:Shell 0.3%Language:Dockerfile 0.2%