Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

303
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda