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
467 Views Asked by NikeAGoGo At
1
There are 1 best solutions below
Related Questions in SPRING-BOOT
- Multi Tenancy in Spring - Partitioned Data Approach
- I have created a spring boot application with spring data JPA, Rest ,oracle and i am getting this ORA-00933: SQL command not properly ended
- Springboot: How to get an entity optional property and check null?
- How to create jasper report in spring boot rest api with jpa
- JSON Body is Not Passing Certain Strings
- Unresolved reference error is showing up after adding the dgs codegen plugin successfully
- Transaction silently rolled back
- JPA buddy error when generating JPA Entities from DB
- Migrating Spring Boot 2 to 3 throws org.glassfish.jaxb.runtime.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
- Hibernate SQL Error: Missing FROM-clause entry for table "th1_1"
- Appwrite and / or Spring Boot Backend
- Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. I'm using Postgresql
- Driver com.microsoft.sqlserver.jdbc.SQLServerDriver claims to not accept jdbcUrl, ${SPRING_DATASOURCE_URL}: GitHub Actions
- springboot class org.hibernate.mapping.Bag cannot be cast to class org.hibernate.mapping.SimpleValue
- Spring security causing 404 with message "No static resource login"
Related Questions in APACHE-KAFKA
- No method found for class java.lang.String in Kafka
- How to create beans of the same class for multiple template parameters in Spring
- Troubleshoot .readStream function not working in kafka-spark streaming (pyspark in colab notebook)
- Handling and ignore UNKNOWN_TOPIC_OR_PARTITION error in Kafka Streams
- Connect Apache Flink with Apache kudu as sink using Pyflink
- Embedded Kafka Failed to Start After Spring Starter Parent Version 3.1.10
- Producer Batching Service Bus Vs Kafka
- How to create a docker composer environment where containers can communicate each other?
- Springboot Kafka Consumer unable to maintain connect to kafka cluster brokers
- Kafka integration between two micro service which can respond back to the same function initiated the request
- Configuring Apache Spark's MemoryStream to simulate Kafka stream
- Opentelemetry Surpresses Kafka Produce Message Java
- Kafka: java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.core.appender.mom.kafka.KafkaManager
- MassTransit Kafka producers configure to send several events to the same Kafka topic
- NoClassDefFoundError when running JAR file with Apache Kafka dependencies
Related Questions in INTEGRATION-TESTING
- S3 integration testing
- UI Integration Testing - Android Instrumentation ref now in android app
- Specflow defination not showing references
- How can I cause mouseenter and mouseleave from dispatched mousemove events
- Automation testing for Flutter app in complex environment
- Error when trying to run an integration test
- Selenium firefox webdriver failed to update gecko (tcp connect error)
- Cannot access a widget by its key during integration test flutter
- How to verify method invocation of a class which is a constructor parameter for another class Mockito Kotlin?
- Exception when using Sqlite with Nhibernate for integration tests
- .Net TestContainers and Integration Tests
- TestContainers - disable test containers based on spring profile
- How to profile integration tests in java
- How do I code an integration test for a .NET 8 web app that checks that when an endpoint has an uncaught exception, the server responds with HTTP 500?
- Integration tests for secure endpoint in quarkus
Related Questions in CONFLUENT-SCHEMA-REGISTRY
- Kafka message not deserializable. How to debug
- Is kafka topics still immutable even deployed on kubernetes pod?
- Failed to sample data: com.google.protobuf.Descriptors$DescriptorValidationException: ".google.protobuf.Timestamp" is not defined
- How to configure docker-compose Kafka connect CDC setup with schema-registy?
- Kafka Connect - Schema Registry - Unknown magic byte error
- KafkaJsonSchemaSerializer adds initial null bytes (00 00 00 00 0C 7B) to the record value
- Using avro for key subject with kafka schema registry
- Azure Schema Registry integration issue
- MassTransit Kafka and Outbox: Getting No such configuration property: "schema.registry.url" Exception
- Confluent schema-registry:download not work into pom.xml file when run clean install
- Class io.confluent.kafka.serializers.subject.TopicNameStrategy could not be found
- Kafka Streams Reduce is returning a "Register operation failed because schema is too large; error code: 42209"
- Can't generate dependent java classes from avro subjects
- Spring kafka serialization error Unknown Type: K
- Produce Kafka message using array in Avro Schema
Related Questions in EMBEDDED-KAFKA
- Embedded Kafka Failed to Start After Spring Starter Parent Version 3.1.10
- I am stuck in fixing compaitible jars in my spring boot kafka testing
- EmbeddedKafka tests failing with java.lang.NoSuchFieldError: id
- Two classes with @EmbeddedKafka fail sporadicallly
- Spring Cloud Stream Application not connecting to EmbeddedKafka when testing
- Failed to create bean with name embeddedKafka , java.lang.NoSuchFieldError: DEFAULT_SOCKET_CONNECTION_SETUP_TIMEOUT_MS
- EmbeddedKafka without spring boot in Juint5
- org.springframework.kafka.KafkaException: Send failed; Topic dpp_cil.dpp.event.external.downstream_response not present in metadata after 60000 ms
- Failed to be assigned partitions from the embedded topics for test
- Gradle, embedded-kafka: Symbol 'type org.apache.zookeeper.server.ServerCnxnFactory' is missing from the classpath
- Kafka consumer transaction is slow, how to tweak it?
- Kafka consumer doesn't received message within time range after change auto.offset.reset=earliest to latest in embeddedKafka junit test
- NoClassDefFoundError for embedded-kafka in scala project
- EmbeddedKafka and GraalVM in Springboot tests
- Embedded Kafka test cases not considered in test case execution
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 # Hahtags
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!