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.

Caveats

  • When exception is raised in consumer handler, the message will be nacked (FastStream doesn't do this by default)

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-2.2.2.tar.gz (8.7 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-2.2.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: faststream_stomp-2.2.2.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for faststream_stomp-2.2.2.tar.gz
Algorithm Hash digest
SHA256 436b380937c4cfc578143b84b353d16b4d9a086e4205ead12937e7f126a4b1c2
MD5 9355274ef1850eebcbbe6f39b24093ba
BLAKE2b-256 8ab3ed466c1829b7f4e34ef33aecbf5b48a34aaa5d0b3efbd5a856cf5b7fb72a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: faststream_stomp-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for faststream_stomp-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf30055eb04cd95dbfc7dc787feb6de1d8b9838b048a784431b42076c7c1d9fe
MD5 6eee7597e88ff431dbc5dac58ae3c23f
BLAKE2b-256 932fc35ebd1c5b600cca83dd8b18fbf671708b8f530266b3ab8fae99db8d6e26

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