Skip to main content

Standalone IBM MQ adapter for FastStream

Project description

faststream-mq

CI Connected IBM MQ tests Docs PyPI Python versions

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

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; 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.

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_mq-0.1.0.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

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

faststream_mq-0.1.0-py3-none-any.whl (46.2 kB view details)

Uploaded Python 3

File details

Details for the file faststream_mq-0.1.0.tar.gz.

File metadata

  • Download URL: faststream_mq-0.1.0.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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_mq-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4e9d128ebf375ef4da709603e366ad3fb573754d778288b887285b9ae4579b6d
MD5 01b9e3dd3fcea621e0c1091cca13d298
BLAKE2b-256 11c390b8e24d9f159c3fd9a1866a5e14255cf2a47b36083e6364556279c05a8e

See more details on using hashes here.

File details

Details for the file faststream_mq-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: faststream_mq-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 46.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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_mq-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c4f61cf467858f0d9d240534cf4c5871bd4213ceb14478111fdcc56d0aaf57f
MD5 c7b61f2b5c90209128089cf2e4aec002
BLAKE2b-256 cdcea47788b1c52372cdf4d8ecc15bcbccfb8569d05d476c2cd107353c4673b7

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