Skip to content

Releases: Lancetnik/Propan

0.1.5.17 (2023-08-04)

04 Aug 17:32
366a509
Compare
Choose a tag to compare

What's Changed

  • DOCS: add Discord widget link to README.md & add a disclaimer about semantic commit messages by @spectacularfailure in #111
  • Docs tweaks by @maxalbert in #117
  • fix: fix bitnami/kafka container version by @Lancetnik in #121
  • feat: add setup_state flag to FastAPI Router to be comaptible with ol… by @Lancetnik in #122

Full Changelog: 0.1.5.15...0.1.5.17

0.1.5.15 (2023-07-27)

27 Jul 20:53
Compare
Choose a tag to compare

What's Changed

Added detail exceptions traceback, fix FastAPI yield dependencies support, fix an empty RMQ message_id parsing, fix some routers' erros, add kafka publish_batch method and some other fixes.

Also:

New Contributors

Full Changelog: 0.1.5.0...0.1.5.15

0.1.5.0 (2023-07-03) NatsJS

03 Jul 19:27
432d7f6
Compare
Choose a tag to compare

Nast Persistent layer

This update adds NATS JetStream (a persistent layer of NATS) supporting.

Now you can work with this great broker without fear of losing messages, using the acknowledgment confirmation mechanism and the built-in key-value and object storages.

Also, some internal classes were changed to further create a synchronous interfaces based on them.

A new section in README: Contibutors!

@bodograumann @v-sopov @hbrooks @sallory, thank you, guys!

0.1.4.0 (2023-06-26) PydanticV2

26 Jun 17:45
Compare
Choose a tag to compare

The main change in this update is the support for the PydanticV2 beta version.

Also, this update still supports Pydantic v1, so if something with PydanticV2 breaks you can simply roll it back - the latest Propan continues to work without changes.

Be careful: if you use Propan together with FastAPI when migrating to PydanticV2, you must install the version fastapi>=0.100.0b1, which is also compatible with both versions of Pydantic. However, if you are working on versions of FastAPI 0.9*, the current release is compatible with them as well (but only using PydanticV1).

All test suites work correctly with all variations of the dependencies and on all supported Python versions.

Other changes:

Improved compatibility with FastAPI:

  • PropanRouter supports top-level dependencies

    from propan.fastapi import RabbitRouter
    
    router = RabbitRouter(dependencies=[...])
    @router.event("test", dependencies=[...])
    async def handler(a: str, b: int):
         ...
  • You can test router.event using build_message directly

    import pytest, pydantic
    from propan.fastapi import RabbitRouter
    from propan.test.rabbit import build_message
    
    router = RabbitRouter()
    
    @router.event("test")
    async def handler(a: str, b: int):
         ...
    
    with pytest.raises(pydantic.ValidationError):
    handler(build_message("Hello", "test"), reraise_exc=True)

Implemented BrokerRouter for the convenience of splitting the application code into imported submodules.

from propan import RabbitBroker, RabbitRouter

router = RabbitRouter(prefix="user/")

@router.handle("created")
async def handle_user_created_event(user_id: str):
     ...

broker = RabbitBroker()
broker.include_router(router)

Added documentation section about custom message serialization (using the example with Protobuf).

And also updated several other sections of the documentation, fixed several non-critical bugs, removed RabbitBroker deprecated methods, and increased test coverage of rare scenarios.

0.1.3.5 (2023-06-16)

16 Jun 11:41
Compare
Choose a tag to compare

What's Changed

Now you can use pydantic.Field to describe your arguments in AsyncAPI spec

from pydantic import Field

@broker.handle(...)
async def handler(
    user_id: str = Field(title="DBUserId", description="UserId at main Postgres")
): ...

Full Changelog: 0.1.3.0...0.1.3.5

0.1.3.0 (2023-06-14) AsyncAPI

14 Jun 19:44
Compare
Choose a tag to compare

The current update adds functionality that I've been working hard on for the last month:
Now Propan can automatically generate and host documentation for your application
according to the AsyncAPI specification.

You can simply provide related teams with a link to your documentation page, where they can get acquainted with all the parameters of the server used, channels, and the format of messages consumed by your service.

HTML-page

You can learn more about this functionality in the corresponding [documentation section] (getting_started/9_documentation.md).

Also, the ability to determine a broker and consumers level dependencies has been added.:

from propan import RabbitBroker, Depends

broker = RabbitBroker(dependencies=[Depends(...)])

@broker.handler(..., dependencies=[Depends(...)])
async def handler():
    ...

Full Changelog: 0.1.2.17...0.1.3.0

0.1.2.17 (2023-06-13)

13 Jun 17:57
Compare
Choose a tag to compare

The current update is a sum of several changes and improvements released from the previous release.

The main change - Propan no longer obliges you to receive a message in the form of only one argument.
Your handler function can consume as many arguments as needed and also combine them with pydantic.BaseModel.

@router.handle(...)
async def handler(a: int, b: float):
...
async def handler(a: Message, b: float, c: str):

A few public methods for declaring objects RabbitMQ were added to RabbitBroker:

broker = RabbitBroker()
...
     await broker.declare_exchange(RabbitExchange("test"))
     await broker.declare_queue(RabbitQueue("test"))
     channel: aio_pika.RobustChannel = broker.channel

To maintain the ability to send messages and initialize channels, an after_startup hook has been added to all FastAPI PropanRouters.

router = RabbitRouter()

@router.after_startup
async def init_whatever(app: FastAPI): ...

In addition, the behavior of the __init__ and connect methods for all brokers have been improved (now the connect parameters have priority and override the __init__ parameters when connecting to the broker), a correct exception has been implemented when accessing an object unavailable for import, several errors have been fixed and other minor internal changes.

New Contributors

0.1.2.3 (2023-05-28) SQS Beta

28 May 11:52
Compare
Choose a tag to compare

Propan added support for SQS as a message broker. This functionality is full tested.

SQSBroker supports:

  • message delivery
  • test client, without the need to run ElasticMQ or connect to cloud SQS
  • FastAPI Plugin

SQSBroker not supports RPC yet.

Also, current release include the following fixes:

  • Kafka connection recovery
  • Nats connection recovery
  • Redis connection methods supports not-url parameters

0.1.2.2 (2023-05-26) Nats Stable

26 May 16:06
Compare
Choose a tag to compare

NatsBroker is full tested now.

Also, to Nats supporting added:

  • TestNatsBroker and test messages to local testing
  • RPC supporting
  • NatsRouter for FastAPI

0.1.2.0 (2023-05-23) Kafka

23 May 14:05
66d2e9c
Compare
Choose a tag to compare

Propan added support for Kafka as a message broker. This functionality is full tested.

KafkaBroker supports:

  • message delivery
  • test client, without the need to run Kafka
  • FastAPI Plugin

KafkaBroker not supports RPC yet.