Skip to content

Commit

Permalink
init subscription demo
Browse files Browse the repository at this point in the history
Co-authored-by: kenichsberg <kn1017356@gmail.com>
  • Loading branch information
Rost-is-love and kenichsberg committed Aug 22, 2024
1 parent b1d0487 commit 24604b4
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
26 changes: 26 additions & 0 deletions subscriptions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# [WIP] Dynamic SubscriptionTopic with destinations

It is a demo of Aidbox SubscriptionTopic with Kafka.

## Prerequisites

- [Docker](https://www.docker.com/)

## STEP 1: Run Kafka and Kafka UI

```shell
docker compose up
```

## STEP 2: Open Kafka UI

Kafka UI available on `http://localhost:8080/`

## STEP 3: Create Kafka Topic

Go `Topics` -> `Add a Topic` -> fill in the form -> `Create Topic`

## STEP 4: Trigger Aidbox Subscription

## Step 5: See messages

38 changes: 38 additions & 0 deletions subscriptions/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: '3.8'

services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"

kafka:
image: confluentinc/cp-kafka:latest
container_name: kafka
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092'
KAFKA_LISTENERS: 'PLAINTEXT://kafka:29092,CONTROLLER://kafka:29093,PLAINTEXT_HOST://0.0.0.0:9092'
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
ports:
- "9092:9092"
depends_on:
- zookeeper

kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- 8080:8080
depends_on:
- kafka
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
DYNAMIC_CONFIG_ENABLED: 'true'
13 changes: 13 additions & 0 deletions subscriptions/kafka-ui-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kafka:
clusters:
-
name: local
bootstrapServers: localhost:9092
# schemaRegistry: http://localhost:8085
# schemaRegistryAuth:
# username: username
# password: password
# schemaNameTemplate: "%s-value"
# metrics:
# port: 9997
# type: JMX

0 comments on commit 24604b4

Please sign in to comment.