build_message
faststream.kafka.test.build_message #
build_message(message: SendableMessage, topic: str, partition: Optional[int] = None, timestamp_ms: Optional[int] = None, key: Optional[bytes] = None, headers: Optional[Dict[str, str]] = None, correlation_id: Optional[str] = None, *, reply_to: str = '') -> ConsumerRecord
Build a Kafka ConsumerRecord for a sendable message.
PARAMETER | DESCRIPTION |
---|---|
message | The sendable message to be encoded. TYPE: |
topic | The Kafka topic for the message. TYPE: |
partition | The Kafka partition for the message. Defaults to None. |
timestamp_ms | The message timestamp in milliseconds. Defaults to None. |
key | The message key. Defaults to None. |
headers | Additional headers for the message. Defaults to None. |
correlation_id | The correlation ID for the message. Defaults to None. |
reply_to | The topic to which responses should be sent. Defaults to "". TYPE: |
RETURNS | DESCRIPTION |
---|---|
ConsumerRecord | A Kafka ConsumerRecord object. TYPE: |