NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3860 most downloaded on PyPI
FastStream: the simplest way to work with a messaging queues
Last release 22 days ago
27 Aug 2026
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
124 releases · first in 2023
One column per quarter.
This is the time for a new NATS features! FastStream supports NATS Key-Value and Object Storage subscribption features in a native way now (big thx fo
This is the time for a new NATS features! FastStream supports NATS Key-Value and Object Storage subscribption features in a native way now (big thx for @sheldygg)!
KeyValue creation and watching API added (you can read updated documentation section for changes):
from faststream import FastStream, Logger
from faststream.nats import NatsBroker
broker = NatsBroker()
app = FastStream(broker)
@broker.subscriber("some-key", kv_watch="bucket")
async def handler(msg: int, logger: Logger):
logger.info(msg)
@app.after_startup
async def test():
kv = await broker.key_value("bucket")
await kv.put("some-key", b"1")
ObjectStore API added as well (you can read updated documentation section for changes):
from faststream import FastStream, Logger
from faststream.nats import NatsBroker
broker = NatsBroker()
app = FastStream(broker)
@broker.subscriber("file-bucket", obj_watch=True)
async def handler(filename: str, logger: Logger):
logger.info(filename)
@app.after_startup
async def test():
object_store = await broker.object_storage("file-bucket")
await object_store.put("some-file.txt", b"1")
Also now you can use just pull_sub=True instead of pull_sub=PullSub() in basic case:
from faststream import FastStream, Logger
from faststream.nats import NatsBroker
broker = NatsBroker()
app = FastStream(broker)
@broker.subscriber("test", stream="stream", pull_sub=True)
async def handler(msg, logger: Logger):
logger.info(msg)
Finally, we have a new feature, related to all brokers: special flag to suppress automatic RPC and reply_to responses:
@broker.subscriber("tests", no_reply=True)
async def handler():
....
# will fail with timeout, because there is no automatic response
msg = await broker.publish("msg", "test", rpc=True)
Full Changelog: https://github.com/airtai/faststream/compare/0.5.7...0.5.8
Finally, FastStream supports OpenTelemetry in a native way to collect the full trace of your services! Big thanks for @draincoder for that!
Finally, FastStream supports OpenTelemetry in a native way to collect the full trace of your services! Big thanks for @draincoder for that!
First of all you need to install required dependencies to support OpenTelemetry:
pip install faststream[otel]
Then you can just add a middleware for your broker and that's it!
from faststream import FastStream
from faststream.nats import NatsBroker
from faststream.nats.opentelemetry import NatsTelemetryMiddleware
broker = NatsBroker(
middlewares=(
NatsTelemetryMiddleware(),
)
)
app = FastStream(broker)
To find detailt information just visit our documentation aboout telemetry
P.S. The release includes basic OpenTelemetry support - messages tracing & basic metrics. Baggage support and correct spans linking in batch processing case will be added soon.
Full Changelog: https://github.com/airtai/faststream/compare/0.5.6...0.5.7
feature: add --factory param by @Sehat1137 in https://github.com/airtai/faststream/pull/1440
from faststream.rabbit.annotations import Connection, Channel shortcutsbroker.add_middleware public API to append a middleware to already created brokerRabbitBroker(channel_number: int, publisher_confirms: bool, on_return_raises: bool) options to setup channel settingsStreamMessage.batch_headers attribute to provide with access to whole batch messages headersFull Changelog: https://github.com/airtai/faststream/compare/0.5.5...0.5.6
Add support for explicit partition assignment in aiokafka KafkaBroker (special thanks to @spataphore1337):
Add support for explicit partition assignment in aiokafka KafkaBroker (special thanks to @spataphore1337):
from faststream import FastStream
from faststream.kafka import KafkaBroker, TopicPartition
broker = KafkaBroker()
topic_partition_fisrt = TopicPartition("my_topic", 1)
topic_partition_second = TopicPartition("my_topic", 2)
@broker.subscribe(partitions=[topic_partition_fisrt, topic_partition_second])
async def some_consumer(msg):
...
Full Changelog: https://github.com/airtai/faststream/compare/0.5.4...0.5.5
Update Release Notes for 0.5.3 by @faststream-release-notes-updater in https://github.com/airtai/faststream/pull/1400
Full Changelog: https://github.com/airtai/faststream/compare/0.5.3...0.5.4
Update Release Notes for 0.5.2 by @faststream-release-notes-updater in https://github.com/airtai/faststream/pull/1382
Full Changelog: https://github.com/airtai/faststream/compare/0.5.2...0.5.3
Just a little bugfix patch. Fixes #1379 and #1376.
Just a little bugfix patch. Fixes #1379 and #1376.
Full Changelog: https://github.com/airtai/faststream/compare/0.5.1...0.5.2
We already have some fixes related to RedisBroker (#1375, #1376) and some new features for you:
We already have some fixes related to RedisBroker (#1375, #1376) and some new features for you:
broke.include_router(...) allows to pass some arguments to setup router at including moment instead of creationbroker.include_router(
router,
prefix="test_",
dependencies=[Depends(...)],
middlewares=[BrokerMiddleware],
include_in_schema=False,
)
KafkaBroker().subscriber(...) now consumes aiokafka.ConsumerRebalanceListener object.
You can find more information about it in the official aiokafka doc(close #1319)
broker = KafkaBroker()
broker.subscriber(..., listener=MyRebalancer())
pattern option was added too, but it is still experimental and does not support Path
Path feature perfomance was increased. Also, Path is suitable for NATS PullSub batch subscribtion as well now.from faststream import NatsBroker, PullSub
broker = NastBroker()
@broker.subscriber(
"logs.{level}",
steam="test-stream",
pull_sub=PullSub(batch=True),
)
async def base_handler(
...,
level: str = Path(),
):
...
Full Changelog: https://github.com/airtai/faststream/compare/0.5.0...0.5.1
However, you won't even notice it—we've preserved all public APIs from breaking changes. The only feature not compatible with the previous code is the…
This is the biggest change since the creation of FastStream. We have completely refactored the entire package, changing the object registration mechanism, message processing pipeline, and application lifecycle. However, you won't even notice it—we've preserved all public APIs from breaking changes. The only feature not compatible with the previous code is the new middleware.
New features:
await FastStream.stop() method and StopApplication exception to stop a FastStream worker are added.
broker.subscriber() and router.subscriber() functions now return a Subscriber object you can use later.
subscriber = broker.subscriber("test")
@subscriber(filter = lambda msg: msg.content_type == "application/json")
async def handler(msg: dict[str, Any]):
...
@subscriber()
async def handler(msg: dict[str, Any]):
...
This is the preferred syntax for filtering now (the old one will be removed in 0.6.0)
router.publisher() function now returns the correct Publisher object you can use later (after broker startup).publisher = router.publisher("test")
@router.subscriber("in")
async def handler():
await publisher.publish("msg")
(Until 0.5.0 you could use it in this way with broker.publisher only)
middlewares can be passed to a broker.publisher as well:broker = Broker(..., middlewares=())
@broker.subscriber(..., middlewares=())
@broker.publisher(..., middlewares=()) # new feature
async def handler():
...
Broker-level middlewares now affect all ways to publish a message, so you can encode application outgoing messages here.
⚠️ BREAKING CHANGE ⚠️ : both subscriber and publisher middlewares should be async context manager type
async def subscriber_middleware(call_next, msg):
return await call_next(msg)
async def publisher_middleware(call_next, msg, **kwargs):
return await call_next(msg, **kwargs)
@broker.subscriber(
"in",
middlewares=(subscriber_middleware,),
)
@broker.publisher(
"out",
middlewares=(publisher_middleware,),
)
async def handler(msg):
return msg
Such changes allow you two previously unavailable features:
Without those features we could not implement Observability Middleware or any similar tool, so it is the job that just had to be done.
7. A better FastAPI compatibility: fastapi.BackgroundTasks and response_class subscriber option are supported.
All .pyi files are removed, and explicit docstrings and methods options are added.
New subscribers can be registered in runtime (with an already-started broker):
subscriber = broker.subscriber("dynamic")
subscriber(handler_method)
...
broker.setup_subscriber(subscriber)
await subscriber.start()
...
await subscriber.close()
faststream[docs] distribution is removed.Full Changelog: https://github.com/airtai/faststream/compare/0.4.7...0.5.0
This is the final API change before stable 0.5.0 release
This is the final API change before stable 0.5.0 release
⚠️ HAS BREAKING CHANGE
In it, we stabilize the behavior of publishers & subscribers middlewares
async def subscriber_middleware(call_next, msg):
return await call_next(msg)
async def publisher_middleware(call_next, msg, **kwargs):
return await call_next(msg, **kwargs)
@broker.subscriber(
"in",
middlewares=(subscriber_middleware,),
)
@broker.publisher(
"out",
middlewares=(publisher_middleware,),
)
async def handler(msg):
return msg
Such changes allows you two features previously unavailable
Without these features we just can't impelement Observability Middleware or any similar tool, so it is the job to be done.
Now you are free to get access at any message processing stage and we are one step closer to the framework we would like to create!
Full Changelog: https://github.com/airtai/faststream/compare/0.5.0rc0...0.5.0rc2
Nothing published for this version
However, you won't even notice it—we've preserved all public APIs from breaking changes. The only feature not compatible with the previous code is the…
This is the biggest change since the creation of FastStream. We have completely refactored the entire package, changing the object registration mechanism, message processing pipeline, and application lifecycle. However, you won't even notice it—we've preserved all public APIs from breaking changes. The only feature not compatible with the previous code is the new middleware.
This is still an RC (Release Candidate) for you to test before the stable release. You can manually install it in your project:
pip install faststream==0.5.0rc0
We look forward to your feedback!
New features:
await FastStream.stop() method and StopApplication exception to stop a FastStream worker are added.
broker.subscriber() and router.subscriber() functions now return a Subscriber object you can use later.
subscriber = broker.subscriber("test")
@subscriber(filter = lambda msg: msg.content_type == "application/json")
async def handler(msg: dict[str, Any]):
...
@subscriber()
async def handler(msg: dict[str, Any]):
...
This is the preferred syntax for filtering now (the old one will be removed in 0.6.0)
router.publisher() function now returns the correct Publisher object you can use later (after broker startup).publisher = router.publisher("test")
@router.subscriber("in")
async def handler():
await publisher.publish("msg")
(Until 0.5.0 you could use it in this way with broker.publisher only)
middlewares can be passed to a broker.publisher as well:broker = Broker(..., middlewares=())
@broker.subscriber(..., middlewares=())
@broker.publisher(..., middlewares=()) # new feature
async def handler():
...
Broker-level middlewares now affect all ways to publish a message, so you can encode application outgoing messages here.
⚠️ BREAKING CHANGE ⚠️ : both subscriber and publisher middlewares should be async context manager type
from contextlib import asynccontextmanager
@asynccontextmanager
async def subscriber_middleware(msg_body):
yield msg_body
@asynccontextmanager
async def publisher_middleware(
msg_to_publish,
**publish_arguments,
):
yield msg_to_publish
@broker.subscriber("in", middlewares=(subscriber_middleware,))
@broker.publisher("out", middlewares=(publisher_middleware,))
async def handler():
...
A better FastAPI compatibility: fastapi.BackgroundTasks and response_class subscriber option are supported.
All .pyi files are removed, and explicit docstrings and methods options are added.
New subscribers can be registered in runtime (with an already-started broker):
subscriber = broker.subscriber("dynamic")
subscriber(handler_method)
...
broker.setup_subscriber(subscriber)
await subscriber.start()
...
await subscriber.close()
faststream[docs] distribution is removed.Full Changelog: https://github.com/airtai/faststream/compare/0.4.7...0.5.0rc0
Update Release Notes for 0.4.6 by @faststream-release-notes-updater in https://github.com/airtai/faststream/pull/1286
apply_types warning notice to subscription/index.md by @Lancetnik in https://github.com/airtai/faststream/pull/1291Full Changelog: https://github.com/airtai/faststream/compare/0.4.6...0.4.7
Add poll in confluent producer to fix BufferError by @kumaranvpl in https://github.com/airtai/faststream/pull/1277
Full Changelog: https://github.com/airtai/faststream/compare/0.4.5...0.4.6
Update Release Notes for 0.4.4 by @faststream-release-notes-updater in https://github.com/airtai/faststream/pull/1260
Full Changelog: https://github.com/airtai/faststream/compare/0.4.4...0.4.5
Add RedisStream batch size option
Add RedisStream batch size option
@broker.subscriber(stream=StreamSub("input", batch=True, max_records=3))
async def on_input_data(msgs: list[str]):
assert len(msgs) <= 3
Full Changelog: https://github.com/airtai/faststream/compare/0.4.3...0.4.4
Allow to specify Redis Stream maxlen option in publisher:
Allow to specify Redis Stream maxlen option in publisher:
@broker.publisher(stream=StreamSub("Output", maxlen=10))
async def on_input_data():
....
Full Changelog: https://github.com/airtai/faststream/compare/0.4.2...0.4.3
fix: correct RMQ Topic testing routing by @Lancetnik in https://github.com/airtai/faststream/pull/1196
Full Changelog: https://github.com/airtai/faststream/compare/0.4.1...0.4.2
Fix: use FastAPI overrides in subscribers by @Lancetnik in https://github.com/airtai/faststream/pull/1189
Full Changelog: https://github.com/airtai/faststream/compare/0.4.0...0.4.1
This release adds support for the Confluent's Python Client for Apache Kafka (TM). Confluent's Python Client for Apache Kafka does not support nativel
This release adds support for the Confluent's Python Client for Apache Kafka (TM). Confluent's Python Client for Apache Kafka does not support natively async functions and its integration with modern async-based services is a bit trickier. That was the reason why our initial supported by Kafka broker used aiokafka. However, that choice was a less fortunate one as it is as well maintained as the Confluent version. After receiving numerous requests, we finally decided to bite the bullet and create an async wrapper around Confluent's Python Client and add full support for it in FastStream.
If you want to try it out, install it first with:
pip install "faststream[confluent]>=0.4.0"
To connect to Kafka using the FastStream KafkaBroker module, follow these steps:
Initialize the KafkaBroker instance: Start by initializing a KafkaBroker instance with the necessary configuration, including Kafka broker address.
Create your processing logic: Write a function that will consume the incoming messages in the defined format and produce a response to the defined topic
Decorate your processing function: To connect your processing function to the desired Kafka topics you need to decorate it with @broker.subscriber(...) and @broker.publisher(...) decorators. Now, after you start your application, your processing function will be called whenever a new message in the subscribed topic is available and produce the function return value to the topic defined in the publisher decorator.
Here's a simplified code example demonstrating how to establish a connection to Kafka using FastStream's KafkaBroker module:
from faststream import FastStream
from faststream.confluent import KafkaBroker
broker = KafkaBroker("localhost:9092")
app = FastStream(broker)
@broker.subscriber("in-topic")
@broker.publisher("out-topic")
async def handle_msg(user: str, user_id: int) -> str:
return f"User: {user_id} - {user} registered"
For more information, please visit the documentation at:
https://faststream.airt.ai/latest/confluent/
Full Changelog: https://github.com/airtai/faststream/compare/0.3.13...0.4.0
This is a preview version of 0.4.0 release introducing support for Confluent-based Kafka broker.
This is a preview version of 0.4.0 release introducing support for Confluent-based Kafka broker.
Here's a simplified code example demonstrating how to establish a connection to Kafka using FastStream's KafkaBroker module:
from faststream import FastStream
from faststream.confluent import KafkaBroker
broker = KafkaBroker("localhost:9092")
app = FastStream(broker)
@broker.subscriber("in-topic")
@broker.publisher("out-topic")
async def handle_msg(user: str, user_id: int) -> str:
return f"User: {user_id} - {user} registered"
Full Changelog: https://github.com/airtai/faststream/compare/0.3.13...0.4.0rc0
Nothing published for this version
New shutdown logic by @Lancetnik in https://github.com/airtai/faststream/pull/1117
Full Changelog: https://github.com/airtai/faststream/compare/0.3.12...0.3.13
fix (#1110): correct RMQ Topic pattern test publish by @Lancetnik in https://github.com/airtai/faststream/pull/1112
Full Changelog: https://github.com/airtai/faststream/compare/0.3.11...0.3.12
By default, NATS subscriber consumes messages with a block per subject. So, you can't process multiple messages from the same subject at the same time
NATS concurent subscriber:
By default, NATS subscriber consumes messages with a block per subject. So, you can't process multiple messages from the same subject at the same time. But, with the broker.subscriber(..., max_workers=...) option, you can! It creates an async tasks pool to consume multiple messages from the same subject and allows you to process them concurrently!
from faststream import FastStream
from faststream.nats import NatsBroker
broker = NatsBroker()
app = FastStream()
@broker.subscriber("test-subject", max_workers=10)
async def handler(...):
"""Can process up to 10 messages concurrently."""
Full Changelog: https://github.com/airtai/faststream/compare/0.3.10...0.3.11
feat: Context initial option by @Lancetnik in https://github.com/airtai/faststream/pull/1086
Full Changelog: https://github.com/airtai/faststream/compare/0.3.9...0.3.10
fix (#1082): correct NatsTestClient stream publisher by @Lancetnik in https://github.com/airtai/faststream/pull/1083
Full Changelog: https://github.com/airtai/faststream/compare/0.3.8...0.3.9
bug: Fix faststream.redis.fastapi.RedisRouter stream and list subscription
faststream.redis.fastapi.RedisRouter stream and list subscriptionTestNatsClient with batch=TrueFull Changelog: https://github.com/airtai/faststream/compare/0.3.7...0.3.8
feat (#974): add FastAPI Context by @Lancetnik in https://github.com/airtai/faststream/pull/1060
Support regular FastStream Context with FastAPI plugin
from fastapi import FastAPI
from faststream.redis.fastapi import RedisRouter, Logger
router = RedisRouter()
@router.subscriber("test")
async def handler(msg, logger: Logger):
logger.info(msg)
app = FastAPI(lifespan=router.lifespan_context)
app.include_router(router)
Full Changelog: https://github.com/airtai/faststream/compare/0.3.6...0.3.7
chore: correct update release CI by @Lancetnik in https://github.com/airtai/faststream/pull/1050
packaging dependencyFull Changelog: https://github.com/airtai/faststream/compare/0.3.5...0.3.6
A large update by @Lancetnik in https://github.com/airtai/faststream/pull/1048
A large update by @Lancetnik in https://github.com/airtai/faststream/pull/1048
Provides with the ability to setup graceful_timeout to wait for consumed messages processed correctly before apllication shutdown - Broker(graceful_timeout=30.0) (waits up to 30 seconds)
context.get_local("message") from FastAPI pluginpublish_batch noticeNackMessage exceptionFull Changelog: https://github.com/airtai/faststream/compare/0.3.4...0.3.5
feat: add support for anyio 4.x by @davorrunje in https://github.com/airtai/faststream/pull/1044
Full Changelog: https://github.com/airtai/faststream/compare/0.3.3...0.3.4
feat: add support for Python 3.12 by @davorrunje in https://github.com/airtai/faststream/pull/1034
Features:
Chores:
Full Changelog: https://github.com/airtai/faststream/compare/0.3.2...0.3.3
feat: add Redis security configuration by @sternakt and @Lancetnik in https://github.com/airtai/faststream/pull/1025
Full Changelog: https://github.com/airtai/faststream/compare/0.3.1...0.3.2
feat: added reply-to delivery mode for RabbitMQ by @Lancetnik in https://github.com/airtai/faststream/pull/1015
Features:
Bug fixes:
Documentation:
Full Changelog: https://github.com/airtai/faststream/compare/0.3.0...0.3.1
The main feature of the 0.3.0 release is added Redis support by @Lancetnik in https://github.com/airtai/faststream/pull/1003
The main feature of the 0.3.0 release is added Redis support by @Lancetnik in https://github.com/airtai/faststream/pull/1003
You can install it by the following command:
pip install "faststream[redis]"
Here is a little code example
from faststream import FastStream, Logger
from faststream.redis import RedisBroker
broker = RedisBroker()
app = FastStream(broker)
@broker.subscriber(
channel="test", # or
# list="test", or
# stream="test",
)
async def handle(msg: str, logger: Logger):
logger.info(msg)
faststream docs serve --reload ... option for documentation hotreloadfaststream run --reload-extension .env option to watch by changes in such filesfaststream run -k 1 -k 2 ... as k=["1", "2"] extra optionsinclude_in_schema: bool argument to disable AsyncAPI renderwatchfiles from default distributionbroker.publisher with already running brokerFastStream application context managerTestBroker(connect_only=...) argument based on ASTNatsMessage.in_progress() methodFull Changelog: https://github.com/airtai/faststream/compare/0.2.15...0.3.0
The main feature of the 0.3.x release is added Redis support by @Lancetnik in https://github.com/airtai/faststream/pull/1003
The main feature of the 0.3.x release is added Redis support by @Lancetnik in https://github.com/airtai/faststream/pull/1003
You can install it manually:
pip install faststream==0.3.0rc0 && pip install "faststream[redis]"
faststream docs serve --reload ... option for documentation hotreloadfaststream run --reload-extension .env option to watch by changes in such filesfaststream run -k 1 -k 2 ... as k=["1", "2"] extra optionsinclude_in_schema: bool argument to disable AsyncAPI renderwatchfiles from default distributionbroker.publisher with already running brokerFastStream application context managerTestBroker(connect_only=...) argument based on ASTNatsMessage.in_progress() methodFull Changelog: https://github.com/airtai/faststream/compare/0.2.15...0.3.0rc0
fix (#972): correct Context default behavior by @Lancetnik in https://github.com/airtai/faststream/pull/973
Full Changelog: https://github.com/airtai/faststream/compare/0.2.14...0.2.15
fix: usage pass apps module rather than file path by @kumaranvpl in https://github.com/airtai/faststream/pull/955
Full Changelog: https://github.com/airtai/faststream/compare/0.2.13...0.2.14
*chore: rRemove uvloop python 3.12 restriction from pyproject by @sternakt in https://github.com/airtai/faststream/pull/914
*chore: rRemove uvloop python 3.12 restriction from pyproject by @sternakt in https://github.com/airtai/faststream/pull/914
Full Changelog: https://github.com/airtai/faststream/compare/0.2.12...0.2.13
feat: NATS polling subscriber by @sheldygg in https://github.com/airtai/faststream/pull/912
Full Changelog: https://github.com/airtai/faststream/compare/0.2.11...0.2.12
fix (#910): correct pydantic enum refs resolving by @Lancetnik in https://github.com/airtai/faststream/pull/911
Full Changelog: https://github.com/airtai/faststream/compare/0.2.10...0.2.11
Now, you can hide your connection secrets in the AsyncAPI schema by manually setting up the server URL:
Now, you can hide your connection secrets in the AsyncAPI schema by manually setting up the server URL:
broker = RabbitBroker(
"amqp://guest:guest@localhost:5672/", # Connection URL
asyncapi_url="amqp://****:****@localhost:5672/", # Public schema URL
)
Additionally, the RabbitMQ AsyncAPI schema has been improved, adding support for faststream.security, and the connection scheme is now defined automatically.
RabbitMQ connection parameters are now merged, allowing you to define the main connection data as a URL string and customize it using kwargs:
broker = RabbitBroker(
"amqp://guest:guest@localhost:5672/",
host="127.0.0.1",
)
# amqp://guest:guest@127.0.0.1:5672/ - The final URL
faststream.security import instead of faststream.broker.securityasyncapi_url broker arg by @Lancetnik in https://github.com/airtai/faststream/pull/903Full Changelog: https://github.com/airtai/faststream/compare/0.2.9...0.2.10
docs: fix grammatical errors in README.md by @JanumalaAkhilendra in https://github.com/airtai/faststream/pull/880
Full Changelog: https://github.com/airtai/faststream/compare/0.2.8...0.2.9
fix: FASTAPI_V2 always True by @shepilov-vladislav in https://github.com/airtai/faststream/pull/877
Full Changelog: https://github.com/airtai/faststream/compare/0.2.7...0.2.8
fix: ImportError: typing 'override' from 'faststream._compat' (python 3.12) by @Jaroslav2001 in https://github.com/airtai/faststream/pull/870
Full Changelog: https://github.com/airtai/faststream/compare/0.2.6...0.2.7
docs: add avro encoding, decoding examples by @kumaranvpl in https://github.com/airtai/faststream/pull/844
Full Changelog: https://github.com/airtai/faststream/compare/0.2.5...0.2.6
fix: pass missing parameters and update docs by @sheldygg in https://github.com/airtai/faststream/pull/841
Full Changelog: https://github.com/airtai/faststream/compare/0.2.4...0.2.5
Now, Context provides access to inner dict keys too:
Now, Context provides access to inner dict keys too:
# headers is a `dict`
async def handler(
user_id: int = Context("message.headers.user_id", cast=True),
): ...
Added Header object as a shortcut to Context("message.headers.") inner fields (NATS example):
# the same with the previous example
async def handler(
user_id: int = Header(),
u_id: int = Header("user_id"), # with custom name
): ...
Added Path object to get access to NATS wildcard subject or RabbitMQ topic routing key (a shortcut to access Context("message.path.") as well):
@nats_broker.subscriber("logs.{level}")
async def handler(
level: str = Path(),
)
Also, the original message Context annotation was copied from faststream.[broker].annotations.[Broker]Message to faststream.[broker].[Broker]Message to provide you with faster access to the most commonly used object (NATS example).
Full Changelog: https://github.com/airtai/faststream/compare/0.2.3...0.2.4
Fix: disable test features with TestClient by @Lancetnik in https://github.com/airtai/faststream/pull/813
Full Changelog: https://github.com/airtai/faststream/compare/0.2.2...0.2.3
Adds specific mypy ignore comment by @kumaranvpl in https://github.com/airtai/faststream/pull/803
Full Changelog: https://github.com/airtai/faststream/compare/0.2.1...0.2.2
Add custom 404 error page by @kumaranvpl in https://github.com/airtai/faststream/pull/792
Full Changelog: https://github.com/airtai/faststream/compare/0.2.0...0.2.1
Add comprehensive guide on how to use faststream template by @kumaranvpl in https://github.com/airtai/faststream/pull/772
Full Changelog: https://github.com/airtai/faststream/compare/0.1.6...0.2.0
Add coverage badge at docs index by @kumaranvpl in https://github.com/airtai/faststream/pull/762
Full Changelog: https://github.com/airtai/faststream/compare/0.1.5...0.1.6
Licence on PyPi updated from MIT to Apache by @davorrunje in https://github.com/airtai/faststream/pull/753
Full Changelog: https://github.com/airtai/faststream/compare/0.1.4...0.1.5
tiny typo by @julzhk in https://github.com/airtai/faststream/pull/740
with_real tests by @Lancetnik in https://github.com/airtai/faststream/pull/751Full Changelog: https://github.com/airtai/faststream/compare/0.1.3...0.1.4
docs: fix styles by @Lancetnik in https://github.com/airtai/faststream/pull/717
Full Changelog: https://github.com/airtai/faststream/compare/0.1.1...0.1.3
Nothing published for this version
Bump ruff from 0.0.289 to 0.0.290 by @dependabot in https://github.com/airtai/faststream/pull/672
Full Changelog: https://github.com/airtai/faststream/commits/0.1.1
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →