FakeProducer
faststream.confluent.testing.FakeProducer #
Bases: AsyncConfluentFastProducer
A fake Kafka producer for testing purposes.
This class extends AsyncConfluentFastProducer and is used to simulate Kafka message publishing during tests.
Source code in faststream/confluent/testing.py
stop async
#
publish async
#
publish(message, topic, key=None, partition=None, timestamp_ms=None, headers=None, correlation_id=None, *, no_confirm=False, reply_to='', rpc=False, rpc_timeout=None, raise_timeout=False)
Publish a message to the Kafka broker.
Source code in faststream/confluent/testing.py
publish_batch async
#
publish_batch(*msgs, topic, partition=None, timestamp_ms=None, headers=None, reply_to='', correlation_id=None, no_confirm=False)
Publish a batch of messages to the Kafka broker.
Source code in faststream/confluent/testing.py
request async
#
request(message, topic, key=None, partition=None, timestamp_ms=None, headers=None, correlation_id=None, *, timeout=0.5)