mrelemerson / log4js-kafka

log4js kafka appender
6 stars 5 forks source link

KafkaJSNonRetriableError Have you encountered? #8

Open XIRALIP opened 4 years ago

XIRALIP commented 4 years ago
2020-06-06 14:29 +08:00: {"level":"ERROR","timestamp":"2020-06-06T06:29:28.649Z","logger":"kafkajs","message":"[Producer] There is no leader for this topic-partition as we are in the middle of a leadership election","retryCount":0,"retryTime":308}
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
KafkaJSNonRetriableError
  Caused by: KafkaJSProtocolError: There is no leader for this topic-partition as we are in the middle of a leadership election
    at createErrorFromCode (/opt/test/nodejs-skills/node_modules/kafkajs/src/protocol/error.js:537:10)
    at Object.parse (/opt/test/nodejs-skills/node_modules/kafkajs/src/protocol/requests/metadata/v0/response.js:66:11)
    at Connection.send (/opt/test/nodejs-skills/node_modules/kafkajs/src/network/connection.js:311:35)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2020-06-06 14:29 +08:00: (node:17) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 localhost:9092-longpolling-ready listeners added. Use emitter.setMaxListeners() to increase limit
XIRALIP commented 4 years ago

this is my configuration:

const configuration : Configuration = {
    appenders: {
        stdout: {
            type: 'console',
        },
        testKafka: {
            type: 'log4js-kafka',
            clientId: 'nodejs-skills',
            brokers: bootstrap_servers ? bootstrap_servers.split(',') : ['localhost:9092'],
            topic: 'test.log.skills.runtime',
            ssl: false,
        },
    },
    categories: {
        default: { appenders: ['stdout', 'file'], level: 'debug' },
        testKafka: { appenders: ['stdout', 'file', 'skills'], level: 'debug' },
    },
    pm2: true,
};