Using custom schema registry for Kafka component requires custom hostname
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
Visual studio enterprise: Version 17.10.0 Preview 4.0
Running Aspire version: 8.0.0-preview.6.24178.5
Trying to add a schema registry using a new resource according to this docker compose:
```yaml
`version: '3.8'
services:
broker:
image: confluentinc/confluent-local:7.6.0
hostname: broker
container_name: broker
ports:
- "9092:9092"
- "9101:9101"
environment:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://broker:9092
KAFKA_DEBUG: "true"
KAFKA_SCHEMA_REGISTRY_URL: http://schema-registry:1223
schema-registry:
image: confluentinc/cp-schema-registry:7.6.1
hostname: schema-registry
container_name: schema-registry
depends_on:
- broker
ports:
- "8081:8081"
environment:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'broker:9092'
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
```
The only way I can get the schema registry to find the kafka server (also created a stackoverflow ticket about this) is to use the hostname of the broker in the schema registry variable "SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS" along with the variable
"KAFKA_ADVERTISED_LISTENERS" = "PLAINTEXT://broker:29092,PLAINTEXT_HOST://broker:9092" (in the kafka component this is set to localhost not broker).
Please advice. Getting the schema registry up and running would be a major piece in our puzzle.
Contributor guide
Assessment
This issue has not been assessed yet.