1.0.0 • Published 3 years ago

@tamnguyen/nodekafka.lab v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Overview

A POC about using nodejs kafka client (Confluent REST Proxy)

Getting started

Start dev mode

npm run start

Run unit test

npm run test

API Documentation

Swagger documentation: http://localhost:3000/docs

Kafka Installation

Start local Kafka

docker-compose -f docker-compose.dev.yml up -d

Verify Kafka Installation

Create test topic

docker exec -it kafka.dev kafka-topics --create --topic test --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1

List topics

docker exec -it kafka.dev kafka-topics --list --zookeeper zookeeper:2181

Test Kafka

Start console producer

docker exec -it kafka.dev kafka-console-producer --topic test --broker-list localhost:9092

Start console consumer

docker exec -it kafka.dev kafka-console-consumer --topic test --bootstrap-server localhost:9092

Verify Kafka REST

List all topics

curl http://localhost:8082/topics -H 'Content-Type: application/vnd.kafka.v2+json'

Reference:

Nexus Installation

docker-compose -f docker-compose.ops.yml up -d

Notes:

  • Admin pwd is located at /nexus-data/admin.password
  • Default user/pwd: admin/82f85eae-201d-4434-bd38-9c4d9b18fce6

Verify installation: open browser to http://localhost:8081/ (login/pwd: admin/admin)