Skip to content

Releases: airtai/faststream

v0.5.28

20 Oct 19:51
3beae64
Compare
Choose a tag to compare

What's Changed

There were a lot of time since 0.5.7 OpenTelemetry release and now we completed Observability features we planned! FastStream supports Prometheus metrics in a native way!

Special thanks to @roma-frolov and @draincoder (again) for it!

To collect Prometheus metrics for your FastStream application you just need to install special distribution

pip install faststream[prometheus]

And use PrometheusMiddleware. Also, it could be helpful to use our ASGI to serve metrics endpoint in the same app.

from prometheus_client import CollectorRegistry, make_asgi_app
from faststream.asgi import AsgiFastStream
from faststream.nats import NatsBroker
from faststream.nats.prometheus import NatsPrometheusMiddleware

registry = CollectorRegistry()

broker = NatsBroker(
    middlewares=(
        NatsPrometheusMiddleware(registry=registry),
    )
)

app = AsgiFastStream(
    broker,
    asgi_routes=[
        ("/metrics", make_asgi_app(registry)),
    ]
)

Moreover, we have a ready-to-use Grafana dashboard you can just import and use!

To find more information about Prometheus support, just visit our documentation.

All changes

New Contributors

Full Changelog: 0.5.27...0.5.28

v0.5.27

14 Oct 19:23
6bdea98
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.5.26...0.5.27

v0.5.26

12 Oct 18:28
c23106e
Compare
Choose a tag to compare

What's Changed

This it the official Python 3.13 support! Now, FastStream works (and tested) at Python 3.8 - 3.13 versions!

Warning: Python3.8 is EOF since 3.13 release and we plan to drop it support in FastStream 0.6.0 version.

Also, current release has little bugfixes related to CLI and AsyncAPI schema.

Full Changelog: 0.5.25...0.5.26

v0.5.25

25 Sep 19:25
59b14f5
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.5.24...0.5.25

v0.5.24

25 Sep 16:12
f3cdffd
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.5.23...0.5.24

v0.5.23

09 Sep 19:44
521eaf2
Compare
Choose a tag to compare

What's Changed

We made last release just a few days ago, but there are some big changes here already!

  1. First of all - you can't use faststream run ... command without pip install faststream[cli] distribution anymore. It was made to minify default (and production) distribution by removing typer (rich and click) dependencies. CLI is a development-time feature, so if you don't need - just don't install! Special thanks to @RubenRibGarcia for this change

  2. The next big change - Kafka publish confirmations by default! Previous FastStream version was working in publish & forgot style, but the new one blocks your broker.publish(...) call until Kafka confirmation frame received. To fallback to previous logic just use a new flag broker.publish(..., no_confirm=True)

  3. Also, we made one more step forward to our 1.0.0 features plan! @KrySeyt implements get_one feature. Now you can use any broker subscriber to get messages in imperative style:

subscriber = broker.subscriber("in")
...
msg = await subscriber.get_one(timeout=5.0)
  1. And the last one: @draincoder continues to develop OTEL support! Now he provides us with an ability to use OTEL spans and baggage in a comfortable FastStream-style. Just take a look at the new documentation section

Big thanks to all new and old contributors who makes such a great release!

New Contributors

Full Changelog: 0.5.22...0.5.23

v0.5.22

05 Sep 18:28
c273500
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.5.21...0.5.22

v0.5.21

05 Sep 13:36
fc26675
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.5.20...0.5.21

v0.5.20

30 Aug 09:51
89bfbac
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.5.19...0.5.20

v0.5.19

24 Aug 20:17
8ec5a42
Compare
Choose a tag to compare

What's Changed

The current release is planned as a latest feature release before 0.6.0. All other 0.5.19+ releases will contain only minor bugfixes and all the team work will be focused on next major one.

There a lot of changes we want to present you now though!

New RPC feature

Our old broker.publish(..., rpc=True) implementation was very limited and ugly. Now we present you a much suitable way to do the same thing - broker.request(...)

from faststream import FastStream
from faststream.nats import NatsBroker, NatsResponse, NatsMessage

broker = NatsBroker()

@broker.subscriber("test")
async def echo_handler(msg):
    return NatsResponse(msg, headers={"x-token": "some-token"})

@app.after_startup
async def test():
    # The old implementation was returning just a message body,
    # so you wasn't be able to check response headers, etc
    msg_body: str = await broker.publish("ping", "test", rpc=True)
    assert msg_body == "ping"
    
    # Now request return the whole message and you can validate any part of it
    # moreover it triggers all your middlewares
    response: NatsMessage = await broker.request("ping", "test")

Exception Middleware

Community asked and community did! Sorry, we've been putting off this job for too long. Thanks for @Rusich90 to help us!
Now you can wrap your application by a suitable exception handlers. Just check the new documentation to learn more.

Details

Also, there are a lot of minor changes you can find below. Big thanks to all our old and new contributors! You are amazing ones!

New Contributors

Full Changelog: 0.5.18...0.5.19