microsoft / microsoft/aspire

Using custom schema registry for Kafka component requires custom hostname

Open
#3,910 16 comments 3 reactions 0 assignees View on GitHub
area-integrations kafka
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.