faststream-mq
Standalone IBM MQ adapter for FastStream.
faststream-mq is an early standalone adapter extracted from pending FastStream IBM MQ work. It is already used in production, but still tracks upstream FastStream work closely. If equivalent IBM MQ support is accepted upstream, this package will be deprecated in favor of upstream FastStream.
Install
pip install faststream-mq
Requires FastStream >=0.7.6,<0.8 and cryptography >=50,<51. Cryptography 50 no longer supports Intel macOS or 32-bit Windows. See its platform changes.
Real IBM MQ connections require IBM MQ native C client libraries. For IBM MQ 9.4 redistributable clients, native runtime support is available on Linux x86-64 and Windows x64. On other platforms supported by its dependencies, the package remains installable so TestMQBroker and non-connected tests can run without native MQ libraries.
Optional integrations:
pip install "faststream-mq[fastapi]"
pip install "faststream-mq[otel]"
pip install "faststream-mq[prometheus]"
pip install "faststream-mq[all]"
Quick start
from faststream import FastStream
from faststream_mq import MQBroker
broker = MQBroker(queue_manager="QM1")
app = FastStream(broker)
@broker.subscriber("DEV.QUEUE.1")
async def handle(message: str) -> None:
print(message)
Run a local IBM MQ broker with Docker Compose:
docker compose up -d ibmmq
Migration from the pending FastStream PR
The standalone adapter intentionally uses faststream_mq as its canonical import package.
# Before
from faststream.mq import MQBroker, TestMQBroker
# After
from faststream_mq import MQBroker, TestMQBroker
There is intentionally no faststream.mq compatibility shim. A standalone package cannot safely inject a submodule into the non-namespace faststream package. See the migration guide for project migration details.
Development
This repository uses uv, uv_build, ruff, ty, and prek.
Install the IBM MQ client SDK first when you need real MQ runtime support on a Supported MQ Client Platform; the ibmmq Python package needs the MQ C headers to build. See the IBM MQ Client SDK docs for details and troubleshooting.
MQ_FILE_PATH="$HOME/.local/opt/mqm" ./scripts/install-mq-client.sh
export MQ_FILE_PATH="$HOME/.local/opt/mqm"
export LD_LIBRARY_PATH="$MQ_FILE_PATH/lib64:$LD_LIBRARY_PATH"
uv sync --all-extras --group dev
uv run prek install
uv run ruff format
uv run ruff check
./scripts/ty-check.sh
uv run pytest
uv run --only-group docs mkdocs build --strict
Connected IBM MQ tests require the local MQ services and a successful client-connectivity probe. See the connected testing docs for details and troubleshooting.
docker compose up -d ibmmq ibmmq_ha2
uv run python scripts/wait-mq-ready.py "127.0.0.1(1414)" "127.0.0.1(1415)"
uv run pytest -m connected
Documentation
Documentation is built with MkDocs using the docs uv dependency group.
Read the Docs can build the site from .readthedocs.yaml without a separate requirements.txt.
uv sync --only-group docs
uv run --only-group docs mkdocs serve
Release
Releases are published from version tags by GitHub Actions using PyPI Trusted Publishing. The release workflow also creates a GitHub Release and attaches the built package artifacts. See the release checklist.
git tag v0.1.0
git push origin v0.1.0
License and attribution
Apache-2.0. This package is extracted from IBM MQ broker work originally written for FastStream and preserves the FastStream upstream attribution and API style where appropriate.
Metadata
Release files for faststream-mq 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| faststream_mq-0.3.0.tar.gz | 31.3 kB | Without provenance | Details for faststream_mq-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| faststream_mq-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for faststream_mq-0.3.0-py3-none-any.whl |
Total release size: 79.2 kB
Release files / faststream_mq-0.3.0.tar.gz
| Download URL | faststream_mq-0.3.0.tar.gz |
|---|---|
| Size | 31.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78e6989d80b117b057ca104ebe0553d54a30c77502d4c1c87619969993647fd2
|
|
BLAKE2b-256 checksum How to use checksums |
e84dc71d5770b1d40e1f2b439497adae94fe58d51b1bf146cb0215f54ac3ceac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","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}
|
Release files / faststream_mq-0.3.0-py3-none-any.whl
| Download URL | faststream_mq-0.3.0-py3-none-any.whl |
|---|---|
| Size | 48.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ffe8677391ecd95f72655c7ff549ae2950b26f3377619f99af558cbcfcc01d5
|
|
BLAKE2b-256 checksum How to use checksums |
a38e26b6419afc1a1c2832a9f4026b468f6dbd7b9de2d2b6d10c08d4671d498f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","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}
|
Security for faststream-mq 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.