Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

308
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda