1
votes

I am seeking a simple workable example which use Spring Cloud Stream Kafka with Confluent Schema Registry (producer & consumer). I followed the spring cloud stream reference guide by adding the following code but it didn't work. Can anyone guide me how to achieve it? Many thanks!

@Bean
public SchemaRegistryClient schemaRegistryClient(@Value("${spring.cloud.stream.schemaRegistryClient.endpoint}") String endpoint){
  ConfluentSchemaRegistryClient client = new ConfluentSchemaRegistryClient();
  client.setEndpoint(endpoint);
  return client;
}
2

2 Answers

1
votes

I tried this schema registry sample and it worked for me. All instructions are mentioned in README file.

1
votes

Here is a simple example that shows spring cloud stream with Avro serialization. This example stubs and mocks out the schema registry.

Your bean looks correct, you just need a running schema registry and configuration for "spring.cloud.stream.schemaRegistryClient.endpoint" in application.properties (or application.yml)