Phase 01: Schema Design Phase 02: Rough Prototyping API + UI
The following compose file will allow you to run a Kafka cluster (3 kafka + 3 zookeeper nodes) in Docker swarm across 3 Swarm Manager nodes.
version: "3.2"
# https://docs.docker.com/compose/compose-file/#long-syntax-3
# https://docs.confluent.io/current/installation/docker/docs/operations/external-volumes.html#data-volumes-for-kafka-zookeeper
volumes:
zookeeper1-data:
This file contains hidden or 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
/******************/ | |
/** Server Code **/ | |
const WebSocket = require('ws'); | |
const apiKey = 'secret-key'; | |
// https://github.com/websockets/ws/blob/master/doc/ws.md#class-websocketserver | |
let verifyClient = (info, cb) => { | |
let submittedApiKey = info.req.headers.apikey; | |
if (!submittedApiKey) { |