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

284
Views
Can't send Kafka messages though topic and producer both exist

I'm working in TypeScript with the KafkaJS library locally, with a single kafka broker. I've connected a producer successfully, have verified that my topic was created, and am generating messages with:


  const changeMessage = {
    key: id,
    value: JSON.stringify(person),
    headers: {
      changeType: status,
    },
  };

Now when I go to send the message:


  try {
    const sendResponse = await producer.send({
      topic: topicName2,
      messages: [changeMessage],
    });
    log.responseFragment(
      { id, topicName2 },
      `Sending changed/added person ${id} to topic ${topicName2}`
    );
  } catch (error) {
    log.error(
    { error }, `Could not send personChangedAdded ${id} to topic ${topicName2}`
    );
  }

Here's the error that I get back:

Could not send personChange to topic topicName2
    error: {
      "name": "KafkaJSError",
      "retriable": true
    }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I had failed to define log.responseFragment(), and when I changed it to a simple log.info() the problem was resolved.

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!