-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e76d1d5
commit b32f2a3
Showing
3 changed files
with
78 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,58 @@ | ||
version: "3.8" | ||
|
||
services: | ||
zookeeper: | ||
image: confluentinc/cp-zookeeper | ||
hostname: zookeeper | ||
ports: | ||
- 2182:2181 | ||
environment: | ||
SERVICE_NAME: zookeeper | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
|
||
kafka: | ||
image: confluentinc/cp-kafka:latest | ||
hostname: localhost | ||
# Redpanda cluster | ||
redpanda-1: | ||
image: docker.redpanda.com/redpandadata/redpanda:v23.1.1 | ||
container_name: redpanda-1 | ||
command: | ||
- redpanda | ||
- start | ||
- --smp | ||
- '1' | ||
- --reserve-memory | ||
- 0M | ||
- --overprovisioned | ||
- --node-id | ||
- '1' | ||
- --kafka-addr | ||
- PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092 | ||
- --advertise-kafka-addr | ||
- PLAINTEXT://redpanda-1:29092,OUTSIDE://localhost:9092 | ||
- --pandaproxy-addr | ||
- PLAINTEXT://0.0.0.0:28082,OUTSIDE://0.0.0.0:8082 | ||
- --advertise-pandaproxy-addr | ||
- PLAINTEXT://redpanda-1:28082,OUTSIDE://localhost:8082 | ||
- --rpc-addr | ||
- 0.0.0.0:33145 | ||
- --advertise-rpc-addr | ||
- redpanda-1:33145 | ||
ports: | ||
# - 8081:8081 | ||
- 8082:8082 | ||
- 9092:9092 | ||
links: | ||
- zookeeper:zookeeper | ||
- 9644:9644 | ||
- 28082:28082 | ||
- 29092:29092 | ||
|
||
redpanda-console: | ||
image: docker.redpanda.com/redpandadata/console:v2.2.2 | ||
container_name: redpanda-console | ||
entrypoint: /bin/sh | ||
command: -c "echo \"$$CONSOLE_CONFIG_FILE\" > /tmp/config.yml; /app/console" | ||
environment: | ||
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" | ||
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://$KAFKA_TEST_BROKER:9092" | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_CREATE_TOPICS: | ||
CONFIG_FILEPATH: /tmp/config.yml | ||
CONSOLE_CONFIG_FILE: | | ||
kafka: | ||
brokers: ["kafka:9092"] | ||
schemaRegistry: | ||
enabled: false | ||
redpanda: | ||
adminApi: | ||
enabled: false | ||
connect: | ||
enabled: false | ||
ports: | ||
- 8080:8080 | ||
depends_on: | ||
- redpanda-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
module Kafka.Admin.Types where | ||
|
||
import Data.Map | ||
|
||
import Kafka.Types | ||
import Kafka.Internal.Setup | ||
|
||
data KafkaAdmin = KafkaAdmin { | ||
adminProperties :: !Kafka | ||
, kpKafkaConf :: !KafkaConf | ||
kcKafkaPtr :: !Kafka | ||
, kcKafkaConf :: !KafkaConf | ||
} | ||
|
||
instance HasKafka KafkaAdmin where | ||
getKafka = kcKafkaPtr | ||
{-# INLINE getKafka #-} | ||
|
||
instance HasKafkaConf KafkaAdmin where | ||
getKafkaConf = kcKafkaConf | ||
{-# INLINE getKafkaConf #-} | ||
|
||
newtype PartitionsCount = PartitionsCount { unPartitionsCount :: Int } deriving (Show, Eq) | ||
newtype ReplicationFactor = ReplicationFactor { unReplicationFactor :: Int } deriving (Show, Eq) | ||
|
||
data NewTopic = NewTopic { | ||
topicName :: TopicName | ||
, topicPartitions :: PartitionsCount | ||
, topicReplicationFactor :: ReplicationFactor | ||
, topicConfig :: Map String String | ||
} deriving (Show) |