Skip to content

Update dependency faststream to ==0.7.* - #129

Open
madnoberson wants to merge 1 commit into
mainfrom
renovate/faststream-0.x
Open

Update dependency faststream to ==0.7.*#129
madnoberson wants to merge 1 commit into
mainfrom
renovate/faststream-0.x

Conversation

@madnoberson

@madnoberson madnoberson commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
faststream project.dependencies minor ==0.6.* -> ==0.7.*

Release Notes

ag2ai/FastStream (faststream)

v0.7.4

Compare Source

What's Changed

New Contributors

Full Changelog: ag2ai/faststream@0.7.3...0.7.4

v0.7.3

Compare Source

What's Changed

New Contributors

Full Changelog: ag2ai/faststream@0.7.2...0.7.3

v0.7.2

Compare Source

What's Changed

New Contributors

Full Changelog: ag2ai/faststream@0.7.1...0.7.2

v0.7.1

Compare Source

What's Changed

TestBroker.aenter was typed to return Broker | list[Broker]. That union is wrong for both usage shapes: mypy rejects .publish() on the single-broker result (the list arm has no such method) and rejects unpacking the multi-broker result (the Broker arm is not iterable).

### Before — both lines fail under `mypy`:
async with TestKafkaBroker(KafkaBroker()) as br:
    await br.publish(None, "test")

### error: Item "list[KafkaBroker]" of "KafkaBroker | list[KafkaBroker]" has no attribute "publish"  [union-attr]

async with TestKafkaBroker(KafkaBroker(), KafkaBroker()) as (br1, br2):

### error: "KafkaBroker" object is not iterable  [misc]
    ...

### After — mypy infers the precise type:
async with TestKafkaBroker(KafkaBroker()) as br:
    reveal_type(br)            # KafkaBroker
    await br.publish(None, "test")

async with TestKafkaBroker(KafkaBroker(), KafkaBroker()) as (br1, br2):
    reveal_type(br1)           # tuple[KafkaBroker, ...] -> KafkaBroker
    await br1.publish(None, "test")
    await br2.publish(None, "test")

Full Changelog: ag2ai/faststream@0.7.0...0.7.1

v0.7.0

Compare Source

What's Changed

🚀 MQTT Support

FastStream now includes a full-featured MQTT broker, installable via pip install faststream[mqtt]. It supports wildcard topic filters, path parameter capture via Path(), QoS levels, per-subscriber ack_policy, and AsyncAPI schema generation.

from faststream import FastStream, Path
from faststream.mqtt import MQTTBroker, MQTTMessage, QoS

broker = MQTTBroker("localhost:1883")
app = FastStream(broker)

@​broker.subscriber(
    "sensors/{device_id}/temperature",
    qos=QoS.AT_LEAST_ONCE,
)
async def on_temperature(body: str, device_id: Annotated[str, Path()]) -> None:
    print(device_id, body)

@​app.after_startup
async def publish_demo() -> None:
    await broker.publish(21.5, "sensors/room1/temperature", qos=QoS.AT_LEAST_ONCE)

🔀 Multi-broker Support

A single FastStream application can now run multiple brokers at the same time. Pass all the brokers directly to the FastStream constructor — each keeps its own subscribers and publishers, and the app starts and stops all of them together. A common use case is bridging two systems: consume from one broker and re-publish to another.

from faststream import FastStream
from faststream.kafka import KafkaBroker
from faststream.nats import NatsBroker

kafka_broker = KafkaBroker("localhost:9092")
nats_broker = NatsBroker("nats://localhost:4222")

app = FastStream(kafka_broker, nats_broker)

@​kafka_broker.subscriber("incoming")
@​nats_broker.publisher("outgoing")
async def from_kafka(msg: str) -> str:

### Bridge the message from Kafka to NATS
    return msg

@​nats_broker.subscriber("outgoing")
async def from_nats(msg: str) -> None:
    print(f"Received from NATS: {msg}")

🗄️ Redis Cluster Support

FastStream's Redis broker now has a dedicated RedisClusterBroker that connects to a Redis Cluster with automatic node discovery. It is a drop-in replacement for RedisBroker — just change the class name and point it at any cluster node.

from faststream import FastStream
from faststream.redis import RedisClusterBroker

### A single URL is enough — the cluster auto-discovers all remaining nodes
broker = RedisClusterBroker("redis://node1:7000")
app = FastStream(broker)

@​broker.subscriber("events")
async def handle_event(msg: str) -> None:
    print(f"Received: {msg}")

@​app.after_startup
async def publish_event() -> None:
    await broker.publish("hello from cluster", "events")

⚠️ Breaking Changes

AsyncAPIRoute parameter renames (PR #​2894)

The AsyncAPIRoute class (used in ASGI hosting) has had two parameters renamed:

Before After Notes
try_it_out=False try_it_out_path=None Disabling try-it-out now uses None instead of False
try_it_out_url="..." try_it_out_path="..." Parameter renamed for clarity
### Before
AsyncAPIRoute("/docs/asyncapi", try_it_out=False)
AsyncAPIRoute("/docs/asyncapi", try_it_out_url="https://api.example.com/asyncapi/try")

### After
AsyncAPIRoute("/docs/asyncapi", try_it_out_path=None)
AsyncAPIRoute("/docs/asyncapi", try_it_out_path="https://api.example.com/asyncapi/try")

Additionally, a new asyncapi_json_path parameter was added (defaults to <path>.json) and its position in the signature changed — use keyword arguments to avoid surprises.


RabbitMQ: durable=True is now the default (PR #​2892)

RabbitQueue and RabbitExchange now default to durable=True (previously False). This aligns with RabbitMQ 4.3+ which disables transient non-exclusive queues by default.

Impact: if you already have a transient (non-durable) queue or exchange of the same name declared on your broker, re-declaration will raise a PRECONDITION_FAILED mismatch error. To opt out, pass durable=False explicitly:

from faststream.rabbit import RabbitQueue

### To keep the old transient behavior:
queue = RabbitQueue("my-queue", durable=False)

Deprecated items removed

The following APIs that were deprecated in earlier 0.x releases have been fully removed in 0.7.0:

  • Publisher/subscriber-level middlewares — use broker-level or app-level middlewares instead.
  • ack_first, no_ack and related subscriber options — replaced by ack_policy=AckPolicy.*
  • RedisJSONMessageParser — removed. All Redis services must now use the binary message format.
  • broker.close() — removed. Use broker.stop() instead.
Features
Bug Fixes
Documentation
Chore / CI

New Contributors

Full Changelog: ag2ai/faststream@0.6.7...0.7.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@madnoberson
madnoberson force-pushed the renovate/faststream-0.x branch from 917f464 to 44ba67c Compare June 4, 2026 03:53
@madnoberson
madnoberson force-pushed the renovate/faststream-0.x branch from 44ba67c to 40fe931 Compare June 26, 2026 03:34
@madnoberson
madnoberson force-pushed the renovate/faststream-0.x branch from 40fe931 to 0104adf Compare July 5, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants