0.5.0rc2
版本发布时间: 2024-04-09 21:08:55
airtai/faststream最新发布版本:0.5.28(2024-10-21 03:51:54)
What's Changed
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
- suppress any exceptions and pas fall-back message body to publishers
- patch any outgoing message headers and other parameters
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!
- Update Release Notes for 0.5.0rc0 by @faststream-release-notes-updater in https://github.com/airtai/faststream/pull/1347
- Generate docs and linter fixes by @davorrunje in https://github.com/airtai/faststream/pull/1348
- Fix types by @davorrunje in https://github.com/airtai/faststream/pull/1349
- chore: update dependencies by @Lancetnik in https://github.com/airtai/faststream/pull/1358
- feat: final middlewares by @Lancetnik in https://github.com/airtai/faststream/pull/1357
Full Changelog: https://github.com/airtai/faststream/compare/0.5.0rc0...0.5.0rc2