Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

302
Views
KafkaJS: how to run a consumer on a remote website/server?

I am trying to stream live data using kafka to our company's website so that I can display a live updating plot.

I have a working JS consumer which I wrote with help from the kafkaJS docs.

Now I want to call this script from an HTML file on our website so that it can read all the incoming data and plot it.

var source = new EventSource('script.js');
source.addEventListener('message', function(e){

  console.log('Message')
  obj = JSON.parse(e.data);
  console.log(obj);
})

On my site this is the error I receive:

EventSource's response has a MIME type ("application/javascript") that is not "text/event-stream". Aborting the connection.

I am not sure if I am heading in the right direction or if this is even possible I am a big noob here and I am struggling to find useful resources.

Any help or guidance would be greatly appreciated.

Thanks a lot

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Kafka is a backend service, and therefore KafkaJS would be a backend client.

If you want to stream data to a frontend client (i.e. the browser), you'd want SSE, Websockets, or other streaming HTTP traffic, which KafkaJS itself does not provide.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!