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
| const STATUS_CODES = { | |
| 100: 'Continue', | |
| 101: 'Switching Protocols', | |
| 102: 'Processing', // RFC 2518, obsoleted by RFC 4918 | |
| 103: 'Early Hints', | |
| 200: 'OK', | |
| 201: 'Created', | |
| 202: 'Accepted', | |
| 203: 'Non-Authoritative Information', | |
| 204: 'No Content', |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Realtime Chart</title> | |
| </head> | |
| <body> |
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
| const kafka = require('kafka-node'); | |
| const socketIO = require('socket.io')(8080) // run socket.io di port 8080 | |
| const Consumer = kafka.Consumer; | |
| const client = new kafka.KafkaClient(); | |
| const io = socketIO; | |
| const consumer = new Consumer( | |
| client, | |
| [ | |
| { topic: 'nodejs', partition: 0} | |
| ], |
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
| { | |
| "name": "learn-kafka-node", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "dependencies": { | |
| "kafka-node": "^4.1.1", | |
| "socket.io": "^2.2.0" | |
| }, | |
| "devDependencies": {}, |
NewerOlder