I'm using KafkaProducer
in my test cases and my producer uses the schemaRegistryUrl
which points a my local instance of Schema Registry
. Is there a way to mock how KafkaProducer
connects with the Schema Registry? That is, to have KafkaProducer/Consumer
in my tests to work without a running instance of Schema Registry.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Serializing a serialized Thrift struct to Kafka in
- Kafka broker shutdown while cleaning up log files
- Getting : Error importing Spark Modules : No modul
- How to transform all timestamp fields when using K
相关文章
- Kafka doesn't delete old messages in topics
- Kafka + Spark Streaming: constant delay of 1 secon
- Spring Kafka Template implementaion example for se
- How to fetch recent messages from Kafka topic
- Determine the Kafka-Client compatibility with kafk
- Kafka to Google Cloud Platform Dataflow ingestion
- Kafka Producer Metrics
- Spark Structured Streaming + Kafka Integration: Mi
Here is an example of stubbing and mocking but with spring cloud stream. Look at the src/test/java/com/example/cloud/avro/ folder.
There absolutely is. The KafkaAvroSerializer and KafkaAvroDeserializer both have a constructor that takes in a SchemaRegistryClient. You can use a MockSchemaRegistryClient as the SchemaRegistryClient. Here's a code snippet showing how to do that: