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.6.tar.gz (9.0 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.6-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: faststream_stomp-2.2.6.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6.tar.gz
Algorithm Hash digest
SHA256 d0426bec29270de4a5cae4182c4500ab97aee33c6113bfd16a24329a56ff8b2a
MD5 56f20e0c9efd919990a9fa71eee2adac
BLAKE2b-256 14559974e84c3b4131178d30015e38bd3a6e2a1964342ace904b4641d5624195

See more details on using hashes here.

File details

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

File metadata

  • Download URL: faststream_stomp-2.2.6-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e81f27feafaac838aa27a8ceb021d02212b37a1ef091b7c54f53c90e1de6cb80
MD5 647be0b4fec55b3fda0c90976619f5e7
BLAKE2b-256 b7be80252973e60f137f8f8abe6fdf38d89aec0894d2f582b0195a9307b6f618

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