I have a Reactor-based Spring Boot Kafka stream processing app that I am working on writing integration tests for. I am using Spring's @EmbeddedKafka broker. It works great, I have it overriding the bootstrap broker urls that get configured on my reactive processor's consumer & publisher, but what I haven't figured out yet is how to deal with the schema registry for my processor when testing. I'm using Confluent's KafkaAvroSerializer and KafkaAvroDeserializer classes and just have the schema.registry.url field configured in my Spring app configs to get injected into the Kafka properties. I'm using Confluent's MockSchemaRegistryClient for the test producer and consumer, but what I need is a way to inject this mock client into the actual consumer and producer in my stream processor code, but I see no way to do that. Almost seems like I need something more like an embedded version of the schema registry to point them to like the embedded broker. Our build pipeline does not support spinning up containers otherwise I'd use Docker or Testcontainers. Anyone else solve this already? Any help or suggestions appreciated.
Mocking SchemaRegistryClient in stream processor Consumer
466 Views Asked by NikeAGoGo At
1
There are 1 best solutions below
Related Questions in SPRING-BOOT
- Timing Issue with Spring Boot Annotation Configuration
- LightAdmin - Customise parsing DateTime with app timezone
- Creating distribution with repackaged spring boot jar using gradle application plugin
- Spring Boot MVC non-role based security
- Add JVM args to spring boot application
- The method and() is undefined for the type HttpSecurity
- swagger ui not working for swagger version 2
- Spring IO Platform 2.0 - Themes/Changes?
- JPA findDistinctPropertyBy magic method doesn't work as expected when using spring-boot-starter-jpa
- Spring boot check external service status on boot
- Running a specific spring batch job amongst several jobs contained withing a spring boot fat jar
- Adding security to rest api service built with Spring Boot app
- Spring Redirecting from Http to Https Breaks Rest Controller Test
- Service not starting using Spring-boot during integration tests
- Spring Boot Actuator Health Returning DOWN
Related Questions in APACHE-KAFKA
- Spark streaming + kafka throughput
- How to diagnose Kafka topics failing globally to be found
- kafka: what do 'soTimeout', 'bufferSize' and 'minBytes' mean for SimpleConsumer?
- Fail to create SparkContext
- Syntax error on tokens, delete these tokens - kafka spring integration demo application
- How could Kafka 0.8.2.1 with offsets.storage=kafka still require ZooKeeper?
- Message Queues: Per Message Guarantees
- How should a Kafka HLC figure out the # of partitions for a topic?
- Kafka multiple consumers for a partition
- Should Apache Kafka and Hadoop be installed seperatedly (on a diffrent cluster)?
- how does one combine kafka-node producer and node tail?
- How to fix NoClassDefFoundError with custom Kafka producer under Eclipse?
- Apache Samza's CheckpointTool won't give away partition offsets
- Offsets for Kafka Direct Approach in Spark 1.3.1
- Simulate kafka broker failures in multi node kafka cluster and what operations and tools to use to mitigate data loss issues
Related Questions in INTEGRATION-TESTING
- TeamCity create arbitrary directory structure on agent
- Integration testing the entity framework - separate the seed method call only for PROD -
- Test case for WCF REST Service
- Spring MockRestServiceServer handling multiple requests to the same URI (auto-discovery)
- Rails 4 Integration Testing Arrays not present in json object inside controllers
- Is there a testing framework that works with threads in Python?
- Dealing with TargetWithLayout in XUNIT
- database restore for integration tests with phpunit
- How to initialize test class before context initialization while Spring testing?
- What should a controller integration test assert
- Maven and python integration test set up
- Amazon Kinesis + Integration Tests
- continuous integration - build separated projects or build all in one?
- How to deploy WildFly datasource with Arquillian?
- Stubbing method in ActionDispatch::IntegrationTest
Related Questions in CONFLUENT-SCHEMA-REGISTRY
- How to ensure constant Avro schema generation and avoid the 'Too many schema objects created for x' exception?
- Is there a way to using kafka schema registry without magic byte?
- Confluent Schema Registry: POST simple JSON schema with object having single property
- Confluent Platform: version-alignment between Confluent Platform and Apache Kafka releases
- Docker Kafka Avro Console Consumer - Connection Refused
- Confluent Replicator ERROR: Failed to translate schema registry record (io.confluent.connect.replicator.schemas.SchemaTranslator:188)
- Unable to register schema in Confluent Schema registry
- AvroConsumer from confluent_kafka raises "'dict' object has no attribute 'get_by_id'"
- Kafka Schemaregistry Protobuf Unsupported root schema of type STRING
- Setting up Kafka on AWS with separate Schema Registry and Kafka Connect Docker images
- Create Kafka Producer that uses a schema, but without schema registry url
- how to configure schema-registry with three kafka clusters using helm?
- Expecting compatibility Error on Confluent Schema when changing Namespace
- Is confluent schema registry "/subjects/{name}" url referring to the topic key or topic value by default?
- Is there a way to set default compatibility level for Confluent Schema Registry?
Related Questions in EMBEDDED-KAFKA
- Mocking SchemaRegistryClient in stream processor Consumer
- Embedded Kafka not showing consumer offset
- NPE Testing Kafka Producer Using Embedded Kafka
- Testing with EmbeddedKafka - Test report
- Spring Cloud Stream deserializing invalid JSON from Kafka Topic
- Listener not consuming message on Test with EmbeddedKafka Spring
- Embedded Kafka test cases not considered in test case execution
- Unit test with EmbeddedKafka
- How to test Spring Kafka Streams
- Spring Contracts: Stubs are runnning on port -1 + Failed to construct kafka producer
- Spring EmbeddedKafka producer not waiting for consumer acknowledgement
- Multiple SpringBootTests using EmbeddedKafka fails with "only one 'RetryTopicConfigurationSupport'"
- Spring Kafka 2.9.3 NoClassDefFound - AlterIsrRequest$Builder on EmbeddedKafka Start up
- Using upgrade.from config in Kafka Streams is causing a "BindException: Address already in use" error in tests using embedded-kafka-schema-registry
- Producer error in Scala Embedded Kafka with Kafka Streams
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I managed to figure this out. If you use a url that begins with
mock://for your test's SerDes, and you override theschema.registry.urlproperty in the@SpringBootTestannotation with the same mock url, then your processor's consumer and producer will also pick up and use this mock schema registry client, and everything just works!