AioKafkaParser
faststream.kafka.parser.AioKafkaParser #
decode_message async staticmethod #
Decodes a message.
| PARAMETER | DESCRIPTION |
|---|---|
msg | The message to be decoded. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
DecodedMessage | The decoded message. |
decode_message_batch async classmethod #
Decode a batch of messages.
| PARAMETER | DESCRIPTION |
|---|---|
msg | A stream message containing a tuple of consumer records. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
List[DecodedMessage] | A list of decoded messages. |
Source code in faststream/kafka/parser.py
parse_message async staticmethod #
Parses a Kafka message.
| PARAMETER | DESCRIPTION |
|---|---|
message | The Kafka message to parse. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
StreamMessage[ConsumerRecord] | A StreamMessage object representing the parsed message. |
Source code in faststream/kafka/parser.py
parse_message_batch async staticmethod #
Parses a batch of messages from a Kafka consumer.
| PARAMETER | DESCRIPTION |
|---|---|
message | A tuple of ConsumerRecord objects representing the messages to parse.
|
| RETURNS | DESCRIPTION |
|---|---|
KafkaMessage | A StreamMessage object containing the parsed messages. |
| RAISES | DESCRIPTION |
|---|---|
NotImplementedError | If any of the messages are silent (i.e., have no sound). |
Static Method
This method is a static method. It does not require an instance of the class to be called.