Skip to main content

webstompy

Documentation Status License: MIT Code style: black

This is webstompy, your friendly Python STOMP interface with WebSocket support. Currently, it supports version 1.1 of the STOMP specification.

Note: webstompy may not be feature-complete or respect the STOMP specification in full detail. It merely suffices our requirements. In case you observe non-standard behavior or missing functionality, feel free to leave an issue in the tracker or provide a pull request.

webstompy is aimed at simplicity of usage.

Documentation

Usage

Assuming you have a local RabbitMQ server with the Web STOMP Plugin running on port 15674 (see below how to set this up), the following example should work and produce a visible result:

from websocket import create_connection
import webstompy

class MyListener(webstompy.StompListener):
    def on_message(self, frame):
        print('Listener caught this frame: ', frame.payload)

ws_echo = create_connection('ws://127.0.0.1:15674/stomp/websocket')

connection = webstompy.StompConnection(connector=ws_echo)
connection.add_listener(MyListener())
connection.connect(login='guest', passcode='guest')
connection.send(destination='/topic/test', message='hello queue a')
connection.subscribe(destination='/topic/test', id='0')
connection.send(destination='/topic/test', message='hello queue b')

Logging

webstompy supports logging via the Python standard logging module. By default, it will just print the log levels WARINING and ERROR. You can control webstompy's logging in your app via

import logging
logging.getLogger("webstompy").setLevel(logging.CRITICAL)

Setup a local RabbitMQ demo

The above usage example can be realized using a RabbitMQ server with the Web STOMP Plugin. RabbitMQ acts as a broker, the example above in the end speaks with itself.

Install RabbitMQ with activated Web STOMP Plugin

Luckily, there is beevelop/rabbitmq-stomp, a Docker image for RabbitMQ with support for STOMP. Install it and run the RabbitMQ server:

docker pull beevelop/rabbitmq-stomp
docker run -d --name rabbit-stomp -p 15674:15674 beevelop/rabbitmq-stomp

Your RabbitMQ server WebSocket will listen on port 15674 and be available via http://127.0.0.1:15674/stomp.

License

MIT License, Copyright (c) 2020 Point 8 GmbH

Metadata

Release files for webstompy 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webstompy 0.1.5
File Size Uploaded Provenance Actions
webstompy-0.1.5.tar.gz 7.3 kB Without provenance Details for webstompy-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for webstompy 0.1.5
File Interpreter ABI Platform Actions
webstompy-0.1.5-py3-none-any.whl Python 3 none any Details for webstompy-0.1.5-py3-none-any.whl

Total release size: 18.1 kB

Release files / webstompy-0.1.5.tar.gz

Download URL webstompy-0.1.5.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1014d3d976fe60eb937927caf4a49744f800ff49afc4817876f059f07db06f8f
BLAKE2b-256 checksum
How to use checksums
a3d2ac7970721f51ccf14ca7bdcac9231b36b2d3ef24cfc62f5b43e715978205
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.1 Darwin/24.1.0

Release files / webstompy-0.1.5-py3-none-any.whl

Download URL webstompy-0.1.5-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b7c64d603d6ba5345fcbb4b6d800598d461aa5f30c17a0ad621d83a3ceb6f67
BLAKE2b-256 checksum
How to use checksums
c1e048524612a02914ec6f553a628336c173e56292a6e1c44ccda81a9cb03126
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.13.1 Darwin/24.1.0

Security for webstompy 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page