.. image:: https://badge.fury.io/py/stomp.py.svg :target: https://badge.fury.io/py/stomp.py :alt: 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.
.. contents:: \ :depth: 1
You can connect to a message broker running on the local machine, and send a message using the following example.
.. code-block:: python
import stomp
conn = stomp.Connection() conn.connect('admin', 'password', wait=True) conn.send(body=' '.join(sys.argv[1:]), destination='/queue/test') conn.disconnect()
Main documentation
_API documentation
(see stomp.github.io
for details on the STOMP protocol itself)quick start
_ section of the main documentationcommand-line interface
_Travis
_ for continuous integration buildstest coverage report
_PyPi stomp.py page
_The current version of stomp.py supports:
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
_:
stomp.py has been perfunctorily tested on:
RabbitMQ
_ (test_rabbitmq.py <https://github.com/jasonrbriggs/stomp.py/blob/dev/tests/test_rabbitmq.py>
_)ActiveMQ
_ (test_activemq.py <https://github.com/jasonrbriggs/stomp.py/blob/dev/tests/test_activemq.py>
_)Artemis
_ (test_artemis.py <https://github.com/jasonrbriggs/stomp.py/blob/dev/tests/test_artemis.py>
_)stompserver
_ (test_stompserver.py <https://github.com/jasonrbriggs/stomp.py/blob/dev/tests/test_stompserver.py>
_)For testing locally, you'll need to install docker (or podman
_). Once installed:
``poetry install``
``make docker-image`` (or ``make podman-image``)
``make run-docker`` (or ``make run-podman``)
``make test``
``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
so that
.. STOMP
: http://stomp.github.io
.. STOMP v1.0
: http://stomp.github.io/stomp-specification-1.0.html
.. STOMP v1.1
: http://stomp.github.io/stomp-specification-1.1.html
.. STOMP v1.2
: http://stomp.github.io/stomp-specification-1.2.html
.. _python3statement.org
: http://python3statement.org/
.. Main documentation
: http://jasonrbriggs.github.io/stomp.py/index.html
.. stomp.github.io
: http://stomp.github.io/
.. quick start
: http://jasonrbriggs.github.io/stomp.py/quickstart.html
.. command-line interface
: http://jasonrbriggs.github.io/stomp.py/commandline.html
.. PyPi stomp.py page
: https://pypi.org/project/stomp.py/
.. API documentation
: http://jasonrbriggs.github.io/stomp.py/api.html
.. test coverage report
: http://jasonrbriggs.github.io/stomp.py/htmlcov/
.. Travis
: https://travis-ci.org/jasonrbriggs/stomp.py
.. 3.1.7 on PyPi
: https://pypi.org/project/stomp.py/3.1.7/
.. 3.1.7 on GitHub
: https://github.com/jasonrbriggs/stomp.py/tree/stomppy-3series
.. ActiveMQ
: http://activemq.apache.org/
.. Artemis
: https://activemq.apache.org/components/artemis/
.. RabbitMQ
: http://www.rabbitmq.com
.. stompserver
: http://stompserver.rubyforge.org
.. _semantic versioning
: https://semver.org/
.. _podman
: https://podman.io/