FastStream is a powerful and easy-to-use Python framework for building asynchronous services interacting with event streams such as Apache Kafka, RabbitMQ, NATS and Redis.
TaskGroup must be closed in the same task it was opened, otherwise exception is raised
This breaks FastKafka when async context manager methods are used separately
Replace task group with asyncio.create_task calls to enable using aenter and aexit methods in FastKafk
If the Zookeeper or Kafka process crashes while creating it's most likely that the requested port is occupied.
To solve this, if the process crashes, try with a randomly generated port.
Implement partition key mechanism for @produces decorator
Implemented behaviour:
A method decorated with @produces can return defined message as-is: the message is wrapped in a Event object with key=None and passed to producer = message sent without defined key, partition chosen at random
A method decorated with @produces can return defined message wrapped in an Event object with key argument value in bytes = message sent to kafka with defined key, partition chosen using the defined key