AMQP to SSE bridge server. Asynchronous message push (Server Sent Events) using discrete client queues.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
xamqp
xconf
xhttp
xmain
xmock
xserv
.gitattributes
.gitignore
.travis.yml
Dockerfile
LICENSE
Makefile
README.md
VERSION
config.yml-dist
go.mod
go.sum
main.go

README.md

Build Status Coverage Status Go Report Card

jesse

AMQP to SSE bridge server.

Asynchronous message push (Server Sent Events) using discrete client queues. This repository provides a HTTP event source server to be used behind a reverse proxy.

 ┌───────────┐                                                                     
 │   client  ├─ register ─> ┌───────────┐   ╔══════════════╗   ┌─────────────┐
 │ [browser] │<─── SSE ─────┤           ├──>║              ╟──>│             │
 └───────────┘              │ rev proxy │   ║    jesse     ║   │ AMQP broker │
 ┌───────────┐              │  [nginx]  │   ║    [this]    ║   │ [RabbitMQ]  │
 │   client  │<─── SSE ─────┤           │<──╢              ║<──┤             │
 │ [browser] ├─ register ─> └───────────┘   ╚══════════════╝   └─────────────┘ 
 └───────────┘
      ...

Installation

Pull (or download) the stable branch to get the most recent stable version. Do not pull the master branch for production as it may contain junk.

# pull latest stable
git clone --depth=1 -b stable https://github.com/dtgorski/jesse.git

# create custom configuration file
cd jesse && cp config.yml-dist config.yml

Adjust the broker.node list setting in the newly created config.yml configuration file. Update the endpoint address(es) of your AMQP 0-9-1 capable broker(s). A multiple brokers setup expects the broker queues to be synchronized. Save the file and continue with:

make docker
docker run -d -p 2069:2069 jesse:latest

The final docker image is based on Alpine Linux and will be about 11 MB in size.

Configuration

The configuration file is config.yml. The jesse service will look up in following locations in the given order:

  • /etc/jesse/config.yml
  • <PATH_OF_JESSE_BINARY>/config.yml

Entries from subsequent configuration sources will overwrite existing values. When a configuration file is not provided at all, jesse will fall back to its defaults - and this is not what you want. Use ./jesse -c to dump the current set up, which may look like follows:

Structure

server:
  listen: 0.0.0.0:2069
broker:
  node:
    - amqp://guest:guest@10.0.0.10:5672/
    - amqp://guest:guest@10.0.0.11:5672/
queue:
  pattern: ${cookie:sid}
  expire:  1800
logger:
  health:
    file: /dev/stderr
  access:
    file: /dev/stdout
header:
  cors:
    Access-Control-Allow-Origin:  '*'
    Access-Control-Allow-Methods: GET, OPTIONS
    Access-Control-Allow-Headers: Content-Type, Accept, Cache-Control
  sse:
    Content-Type:      text/event-stream; charset=utf-8
    Cache-Control:     no-cache
    Transfer-Encoding: identity
    X-Accel-Buffering: no

License

MIT - © dtg [at] lengo [dot] org