testcontainers / testcontainers/testcontainers-java
Support for Kafka Schema registry
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 8.7k
- Fork
- 1.9k
- Merge medio
- 2g 17h
- PR unite (30g)
- 9
Descrizione
I use the Kafka test container which work really well. The only issue that I have is that I use protobuf/avro encoding for my messages. This means I need to run the schema registry container.
Would it be possible to provide the schema registry out of the box and document it in the docs ? I'm willing to create a PR but I prefer to ask first.
See below the definition that I use in my unit test:
public class SchemaRegistryContainer extends GenericContainer<SchemaRegistryContainer> {
public SchemaRegistryContainer() {
this("5.5.1");
}
public SchemaRegistryContainer(String version) {
super("confluentinc/cp-schema-registry:" + version);
withExposedPorts(8081);
}
public SchemaRegistryContainer withKafka(KafkaContainer kafka) {
withEnv("SCHEMA_REGISTRY_HOST_NAME", "schema-registry");
withEnv("SCHEMA_REGISTRY_LISTENERS", "http://0.0.0.0:8081");
withEnv(
"SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS",
"PLAINTEXT://" + kafka.getNetworkAliases().get(0) + ":9092");
return self();
}
public String getSchemaRegistryUrl() {
return "http://" + getContainerIpAddress() + ":" + getMappedPort(8081);
}
}
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando i punti di ingresso di KafkaContainer e GenericContainer, quindi confronta l'esempio di SchemaRegistryContainer dell'issue con i moduli container esistenti del progetto. Il lavoro è completato quando il supporto per Schema Registry è disponibile per i test Kafka e il suo utilizzo è documentato per i messaggi protobuf o Avro.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, java, kafka
- Ambito
- testing
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100