问题
After integration of Kafka in reactjs, some issue's happening as follow.
kafkaClient.js:728 Uncaught TypeError: net.createConnection is not a function
at KafkaClient.push../node_modules/kafka-node/lib/kafkaClient.js.KafkaClient.createBroker (kafkaClient.js:728)
at KafkaClient.push../node_modules/kafka-node/lib/kafkaClient.js.KafkaClient.setupBroker (kafkaClient.js:314)
at KafkaClient.push../node_modules/kafka-node/lib/kafkaClient.js.KafkaClient.connectToBroker (kafkaClient.js:253)
at kafkaClient.js:198
at Object.doWhilst (async.js:3149)
at KafkaClient.push../node_modules/kafka-node/lib/kafkaClient.js.KafkaClient.connectToBrokers (kafkaClient.js:197)
at kafkaClient.js:155
at async.js:4041
at replenish (async.js:1041)
at async.js:1047
at eachOfLimit (async.js:1073)
at async.js:1078
at _parallel (async.js:4040)
at Object.series (async.js:4917)
at RetryOperation._fn (kafkaClient.js:154)
at RetryOperation.push../node_modules/retry/lib/retry_operation.js.RetryOperation.attempt (retry_operation.js:104)
at KafkaClient.push../node_modules/kafka-node/lib/kafkaClient.js.KafkaClient.connect (kafkaClient.js:146)
at new KafkaClient (kafkaClient.js:100)
at Module.<anonymous> (MessageList.js:16)
at Module../src/components/MessageList.js (MessageList.js:188)
at __webpack_require__ (bootstrap:782)
at fn (bootstrap:150)
at Module../src/App.js (App.css?da7c:45)
at __webpack_require__ (bootstrap:782)
at fn (bootstrap:150)
at Module../src/index.js (index.css?02e3:45)
at __webpack_require__ (bootstrap:782)
at fn (bootstrap:150)
at Object.0 (Request.js:37)
at __webpack_require__ (bootstrap:782)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
Please help on this, how to resolve the kafka-node issue's in reactjs?
来源:https://stackoverflow.com/questions/53929853/after-integration-of-kafka-in-reactjs-some-issues-happening