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

144
Visualizações
Is there a way for the consumer the get the n last messages with KafkaJS?

im new to Kafka and KafkaJS.

Im trying to find a way to get the last n messages sent to a topic, instead of getting all non-consumed messages of that topic.

For example, I have a producer that produces 1 message per second and let it wait for 5 seconds.

Then, when I start the consumer, the consumer gets all 5 messages. ( Only 1 consumer running, 1 group, 1 partition, same topic as producer ).

Is there a configuration on KafkaJS to get only the last n produced messages?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You could poll a single record, or otherwise list the offsets of the topic beforehand.

Then you can seek a consumer to high_offset - N and start polling from there

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