efrecon / tcl-stomp

A STOMP server and client library in Tcl
ISC License
1 stars 0 forks source link

stomp-tcl

This project is a near-complete implementation of the STOMP protocol in Tcl. The project provides a library for both the implementation of servers and clients. In addition, three utilities are provided, highlighting the possibilities of the library.

Library

The Tcl STOMP library implements the an almost complete STOMP v1.2 client library, together with all the necessary buiding blocks for sending and/or receiving STOMP messages in clients and server. A sub package implement all messaging (in and out) support, while the main package provides for a utility layer allowing callers to send and receive STOMP messages to/from servers with little effort.

The messaging layer provides the following core facilities:

The STOMP layer encapsulates all traffic to a remote server into a single object. The layer provides an implementation that follows the v1.2 of the specification, except that it does not directly offers support for transactions. The library offers the following core facilities:

Utilities and Examples

stompserver

The stompserver is a simple STOMP server, highlighting the capabilities of the server implementation of the library. The server has simple support for:

To get you going, self-signed certificates can be created using OpenSSL and the following commands (adapt to your own needs):

openssl genrsa -out server-private.pem 2048

openssl req -new -x509 \
        -key server-private.pem -out server-public.pem \
    -batch -days 3650 \
    -subj "/countryName=SE/stateOrProvinceName=Stockholm/localityName=Kista/organizationName=SICS/commonName=stompserver/emailAddress=emmanuel@sics.se"

stomper

Stomper will listen on stdin and send any non empty line as a STOMP message onto a topic which path is specified by the option -topic

printer

Printer performs the opposite of stomper, i.e. it subscribes to a given topic and prints outs messages sent onto that topic onto stdout. Printer is able to filter only messages of a givven MIME type using the option -type.