oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.28k stars 2.69k forks source link

Fail to connect kafkajs producer #6429

Open davidestrela opened 11 months ago

davidestrela commented 11 months ago

What version of Bun is running?

1.0.4

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

Create a test.ts and paste the following example

const { Kafka } = require('kafkajs');

const kafka = new Kafka({
    clientId: 'kafka-test',
    brokers: [
        'localhost:29092',
        'localhost:39092',
    ],
    requestTimeout: 2000
});

const producer = kafka.producer({
    idempotent: true,
    maxInFlightRequests: 1,
    acks: -1,
});

console.log('Before connect')
await producer.connect();
console.log('After connect')

run bun test.ts

What is the expected behavior?

The promise to connect the producer should be resolved

What do you see instead?

The application is stuck at producer connection

Additional information

The problem seems to be with the configuration of the producer, if i remove the idempotent, the connection is established

HidayetCanOzcan commented 11 months ago

https://github.com/oven-sh/bun/issues/6571#issuecomment-1773608427