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.2.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.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: faststream_stomp-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 1341cc2812cedb9b7ac7fcfd76b85079500b5d6019743d4b5578e0f253646e94
MD5 d29268641cf3cf119f4fa1aba4e2cecb
BLAKE2b-256 bce7fd989fb5665914808e3ed4b8a35507a913687024597219134490483e5505

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for faststream_stomp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc46a6737114952920b5058b33875191617d91fff477398f765f6cb640573823
MD5 961f25a47850740b56b0fc842da99aa0
BLAKE2b-256 896eae2d4481bb454f14344cf34c63ec7430c6d5c95ee6ba8e2c9621b1c11a89

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