Skip to main content

FastStream STOMP broker

Project description

FastStream STOMP broker

How To Use

Install the package:

uv add faststream-stomp
poetry add faststream-stomp

Basic usage:

import asyncio

import faststream
import faststream_stomp
import stompman

server = stompman.ConnectionParameters(host="127.0.0.1", port=61616, login="admin", passcode="password")
broker = faststream_stomp.StompBroker(stompman.Client([server]))


@broker.subscriber("first")
@broker.publisher("second")
def _(message: str) -> str:
    print(message)  # this will print message from startup
    return "Hi from first handler!"


@broker.subscriber("second")
def _(message: str) -> None:
    print(message)  # this will print message from first handler


app = faststream.FastStream(broker)


@app.after_startup
async def send_first_message() -> None:
    await broker.connect()
    await broker.publish("Hi from startup!", "first")


if __name__ == "__main__":
    asyncio.run(app.run())

Also there are StompRouter and TestStompBroker for testing. It works similarly to built-in brokers from FastStream, I recommend to read the original FastStream documentation.

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

faststream_stomp-0.3.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

faststream_stomp-0.3.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file faststream_stomp-0.3.0.tar.gz.

File metadata

  • Download URL: faststream_stomp-0.3.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.26

File hashes

Hashes for faststream_stomp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bced57c9f5e810a8cc8a4ac117731fb52bb39d7d3d89e00979263be77e260cba
MD5 2c1c4d5b9f8649667b9ea3ca8618d6c7
BLAKE2b-256 79bb269db35d53d8890dc0dc13d1fe33ea4886b6bb2d4b6004e9b3c08f21286d

See more details on using hashes here.

File details

Details for the file faststream_stomp-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for faststream_stomp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 807f61237065fe8ccf3e49b2e76cbd1e6b9ac1329449487411e4551c1204530e
MD5 61b7ddcb60ac9e90c70631f2a46ecbb6
BLAKE2b-256 b7f26be8eb07bcda17f7b48d5be6fa7ce53ae7af98d028cc1cb4ebbb2087498b

See more details on using hashes here.

Supported by

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