Skip to main content

Python STOMP client, supporting versions 1.0, 1.1 and 1.2 of the protocol

Project description

PyPI version

“stomp.py” is a Python client library for accessing messaging servers (such as ActiveMQ, Artemis or RabbitMQ) using the STOMP protocol (STOMP v1.0, STOMP v1.1 and STOMP v1.2). It can also be run as a standalone, command-line client for testing. NOTE: Stomp.py has officially ended support for Python2.x. See python3statement.org for more information.

Quick Start

You can connect to a message broker running on the local machine, and send a message using the following example.

import stomp

conn = stomp.Connection()
conn.connect('admin', 'password', wait=True)
conn.send(body=' '.join(sys.argv[1:]), destination='/queue/test')
conn.disconnect()

Documentation and Resources

The current version of stomp.py supports:

  • Python 3.x (Python2 support ended as of Jan 2020)

  • STOMP version 1.0, 1.1 and 1.2

There is also legacy 3.1.7 version using the old 3-series code (see 3.1.7 on PyPi and 3.1.7 on GitHub). This is no longer supported, but (at least as of 2018) there were still a couple of reports of this version still being used in the wild.

Note: stomp.py now follows semantic versioning:

  • MAJOR version for incompatible API changes,

  • MINOR version for functionality added in a backwards compatible manner, and

  • PATCH version for backwards compatible bug fixes.

Testing

stomp.py has been perfunctorily tested on:

For testing locally, you’ll need to install docker (or podman). Once installed:

  1. Install dependencies:

    poetry install

  2. Create the docker (or podman) image:

    make docker-image (or make podman-image)

  3. Run the container:

    make run-docker (or make run-podman)

  4. Run stomp.py unit tests:

    make test

  5. Cleanup the container afterwards if you don’t need it any more:

    make remove-docker (or make remove-podman)

If you want to connect to the test services locally (other than from the included tests), you’ll want to add test domain names to your hosts file like so:
172.17.0.2 my.example.com
172.17.0.2 my.example.org
172.17.0.2 my.example.net

If you’re using podman and you want to access services via their private IP addresses, you’ll want to run your commands with:

podman unshare --rootless-netns <command>

so that <command> has access to the private container network. Service ports are also exposed to the host and can be accessed directly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stomp_py-8.1.2.tar.gz (39.2 kB view details)

Uploaded Source

Built Distribution

stomp_py-8.1.2-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

Details for the file stomp_py-8.1.2.tar.gz.

File metadata

  • Download URL: stomp_py-8.1.2.tar.gz
  • Upload date:
  • Size: 39.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.8 Linux/6.1.84-1-MANJARO

File hashes

Hashes for stomp_py-8.1.2.tar.gz
Algorithm Hash digest
SHA256 b56e62da090863cc65e5fbf832230318cd53e99dc777de19ecb04e83914f1371
MD5 cf433794b2aca73ac7377b57e913f437
BLAKE2b-256 bdc0aa3cfd73ac85d4db8f5d498e1a09d0ece03d48fa8ef6f84cb3b44a3e90a2

See more details on using hashes here.

File details

Details for the file stomp_py-8.1.2-py3-none-any.whl.

File metadata

  • Download URL: stomp_py-8.1.2-py3-none-any.whl
  • Upload date:
  • Size: 42.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.8 Linux/6.1.84-1-MANJARO

File hashes

Hashes for stomp_py-8.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61200b85442a0f374155820f122518371c9c3dc77bb320ae9052d5a840fc5875
MD5 d4aff22a7fbed3fdfea7be50f8ab36e3
BLAKE2b-256 531d9d99ea25492c0f4e97e23c3c8bb2d7b21b43aa589bc920a35e59d6e02be3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page