simplexmq: SimpleXMQ message broker

[ agpl, chat, cryptography, library, network, program, system, web ] [ Propose Tags ]

This package includes server, client and agent for SMP protocols:

See terminal chat prototype built with SimpleXMQ broker.


[Skip to Readme]
Versions [RSS] [faq] 0.3.1, 0.3.2
Change log CHANGELOG.md
Dependencies ansi-terminal (==0.10.*), asn1-encoding (==0.9.*), asn1-types (==0.3.*), async (==2.2.*), attoparsec (==0.13.*), base (>=4.7 && <5), base64-bytestring (>=1.0 && <1.3), bytestring (==0.10.*), containers (==0.6.*), cryptonite (==0.27.*), cryptostore (==0.2.*), directory (==1.3.*), filepath (==1.4.*), generic-random (==1.3.*), ini (==0.4.*), iso8601-time (==0.1.*), memory (==0.15.*), mtl (==2.2.*), network (==3.1.*), network-transport (==0.5.*), optparse-applicative (==0.15.*), QuickCheck (==2.14.*), random (==1.1.*), simple-logger (==0.1.*), simplexmq, sqlite-simple (==0.4.*), stm (==2.5.*), template-haskell (==2.16.*), text (==1.2.*), time (==1.9.*), transformers (==0.5.*), unliftio (==0.2.*), unliftio-core (==0.2.*), websockets (==0.12.*), x509 (==1.7.*) [details]
License AGPL-3.0-only
Copyright 2020 simplex.chat
Author simplex.chat
Maintainer chat@simplex.chat
Category Chat, Network, Web, System, Cryptography
Home page https://github.com/simplex-chat/simplexmq#readme
Uploaded by epoberezkin at 2021-05-23T12:03:38Z
Distributions
Executables smp-server, smp-agent
Downloads 71 total (44 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2021-05-23 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Candidates


Readme for simplexmq-0.3.2

[back to package description]

SimpleXMQ

GitHub build GitHub release

Message broker for unidirectional (simplex) queues

SimpleXMQ is a message broker for managing message queues and sending messages over public network. It consists of SMP server, SMP client library and SMP agent that implement SMP protocol for client-server communication and SMP agent protocol to manage duplex connections via simplex queues on multiple SMP servers.

SMP protocol is inspired by Redis serialization protocol, but it is much simpler - it currently has only 8 client commands and 6 server responses.

SimpleXMQ is implemented in Haskell - it benefits from robust software transactional memory (STM) and concurrency primitives that Haskell provides.

SimpleXMQ roadmap

  • Streams - high performance message queues. See Streams RFC for details.
  • "Small" connection groups, when each message will be sent by the SMP agent to multiple connections with a single client command. See Groups RFC for details.
  • SMP agents cluster to share connections and message management by multiple agents (for example, it would enable multi-device use for simplex-chat).
  • SMP queue redundancy and rotation in SMP agent duplex connections.
  • "Large" groups design and implementation.

Components

SMP server

SMP server can be run on any Linux distribution without any dependencies. It uses in-memory persistence with an optional append-only log of created queues that allows to re-start the server without losing the connections. This log is compacted on every server restart, permanently removing suspended and removed queues.

To enable the queue logging, uncomment enable: on option in smp-server.ini configuration file that is created the first time the server is started.

On the first start the server generates an RSA key pair for encrypted transport handshake and outputs hash of the public key every time it runs - this hash should be used as part of the server address: <hostname>:5223#<key hash>.

SMP server implements SMP protocol.

SMP client library

SMP client is a Haskell library to connect to SMP servers that allows to:

  • execute commands with a functional API.
  • receive messages and other notifications via STM queue.
  • automatically send keep-alive commands.

SMP agent

SMP agent library can be used to run SMP agent as part of another application and to communicate with the agent via STM queues, without serializing and parsing commands and responses.

Haskell type ACommand represents SMP agent protocol to communicate via STM queues.

See simplex-chat terminal UI for the example of integrating SMP agent into another application.

SMP agent executable can be used to run a standalone SMP agent process that implements plaintext SMP agent protocol via TCP port 5224, so it can be used via telnet. It can be deployed in private networks to share access to the connections between multiple applications and services.

Using SMP server and SMP agent

You can either run SMP server locally or try local SMP agent with the deployed demo server:

smp1.simplex.im:5223#pLdiGvm0jD1CMblnov6Edd/391OrYsShw+RgdfR0ChA=

It's the easiest to try SMP agent via a prototype simplex-chat terminal UI.

SMP server design

SMP server design

SMP agent design

SMP agent design

License

AGPL v3