Skip to content

Releases: airtai/faststream

v0.5.15

18 Jul 19:44
15cbe6b
Compare
Choose a tag to compare

What's Changed

Finally, FastStream has a Kafka pattern subscription! This is another step forward in our Roadmap moving us to 0.6.0 and futher!

from faststream import Path
from faststream.kafka import KafkaBroker

broker = KafkaBroker()

@broker.subscriber(pattern="logs.{level}")
async def base_handler(
    body: str,
    level: str = Path(),
):
    ...

Also, all brokers now supports a new ping method to check real broker connection

is_connected: bool = await broker.ping()

This is a little, but important change for K8S probes support

More other there are a lot of bugfixes and improvements from our contributors! Thanks to all of these amazing people!

New Contributors

Full Changelog: 0.5.14...0.5.15

v0.5.14

26 Jun 06:43
4a2341d
Compare
Choose a tag to compare

What's Changed

  • Update Release Notes for 0.5.13 by @faststream-release-notes-updater in #1548
  • Add allow_auto_create_topics to make automatic topic creation configurable by @kumaranvpl in #1556

Full Changelog: 0.5.13...0.5.14

v0.5.13

21 Jun 16:26
c277898
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.5.12...0.5.13

v0.5.12

11 Jun 06:29
df2a0a1
Compare
Choose a tag to compare

What's Changed

Now, FastStream provides users with the ability to pass the config dictionary to confluent-kafka-python for greater customizability. The following example sets the parameter topic.metadata.refresh.fast.interval.ms's value to 300 instead of the default value 100 via the config parameter.

from faststream import FastStream
from faststream.confluent import KafkaBroker

config = {"topic.metadata.refresh.fast.interval.ms": 300}
broker = KafkaBroker("localhost:9092", config=config)
app = FastStream(broker)
  • Update Release Notes for 0.5.11 by @faststream-release-notes-updater in #1511
  • docs: update filters example by @Lancetnik in #1516
  • Add config param to pass additional parameters to confluent-kafka-python by @kumaranvpl in #1505

Full Changelog: 0.5.11...0.5.12

v0.5.11

07 Jun 16:23
a3c353f
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.5.10...0.5.11

v0.5.10

29 May 12:46
031fd31
Compare
Choose a tag to compare

What's Changed

Now you can return Response class to set more specific outgoing message parameters:

from faststream import Response

@broker.subscriber("in")
@broker.subscriber("out")
async def handler():
    return Response(body=b"", headers={})

New Contributors

Full Changelog: 0.5.9...0.5.10

v0.5.9

24 May 10:47
9505fad
Compare
Choose a tag to compare

What's Changed

  • Update Release Notes for 0.5.8 by @faststream-release-notes-updater in #1462
  • Exclude typing_extensions version 4.12.* by @kumaranvpl in #1467
  • fix: add group/consumer to hash to avoid overwriting by @fbraem in #1463
  • Bump version to 0.5.9 by @kumaranvpl in #1468

New Contributors

Full Changelog: 0.5.8...0.5.9

v0.5.8

23 May 19:36
82853db
Compare
Choose a tag to compare

What's Changed

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)!

  1. 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")
  2. 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")
  3. 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)

New Contributors

Full Changelog: 0.5.7...0.5.8

v0.5.7

19 May 12:11
e0ec055
Compare
Choose a tag to compare

What's Changed

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.

New Contributors

Full Changelog: 0.5.6...0.5.7

v0.5.6

16 May 17:52
1bcbcf5
Compare
Choose a tag to compare

What's Changed

  • feature: add --factory param by @Sehat1137 in #1440
  • feat: add RMQ channels options, support for prefix for routing_key, a… by @Lancetnik in #1448
  • feature: Add from faststream.rabbit.annotations import Connection, Channel shortcuts
  • Bugfix: RabbitMQ RabbitRouter prefix now affects to queue routing key as well
  • Feature (close #1402): add broker.add_middleware public API to append a middleware to already created broker
  • Feature: add RabbitBroker(channel_number: int, publisher_confirms: bool, on_return_raises: bool) options to setup channel settings
  • Feature (close #1447): add StreamMessage.batch_headers attribute to provide with access to whole batch messages headers

New Contributors

Full Changelog: 0.5.5...0.5.6