Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some message is missing #1046

Open
tuafree opened this issue Oct 13, 2023 · 0 comments
Open

Some message is missing #1046

tuafree opened this issue Oct 13, 2023 · 0 comments

Comments

@tuafree
Copy link

tuafree commented Oct 13, 2023

I sent one-by-one message to the producer, please see my code below,

const producer = new Kafka.Producer(
{
'bootstrap.servers': ${process.env.KAFKA_SERVER},
'sasl.username': ${process.env.KAFKA_USERNAME},
'sasl.password': ${process.env.KAFKA_PASSWORD},
'security.protocol': 'sasl_ssl',
'sasl.mechanisms': 'PLAIN',
'client.id': ${process.env.KAFKA_CLIENT_ID},
'dr_cb': true,
'enable.idempotence': true
},
{
'request.required.acks': -1,
},
);

producer.setPollInterval(100);

producer.connect({}, (err, data) => {
  if (err) {
    console.log('CONNECT ERROR: ', err)
  }
});

producer.on('ready', async function () {
  const key: string = uuid + `-` + providerRefCode + `-` + Date.now();
  producer.produce(
    topic,
    -1,
    data,
    key,
    Date.now()
  );
  producer.poll();
});

producer.on('delivery-report', function (err, report) {
  if (err) {
    console.log('REPORT ERROR: ', JSON.stringify(err))
  }
  producer.disconnect();
});

producer.on('event.error', function (err) {
  console.error(err);
  if (err.code == -1) {
    producer.disconnect();
  }
});

I found some messages missing from the target database without an error message. How to find the root cause?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant