Skip to content

Commit d4f671f

Browse files
committed
Fix merge issue in conflict, update security dependency
1 parent 1fe9143 commit d4f671f

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

examples/kafkajs/consumer.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
const { Kafka } = require('../..').KafkaJS;
1+
const { Kafka, logLevel } = require('../..').KafkaJS;
22
//const { Kafka } = require('kafkajs')
33

44
async function consumerStart() {
55
let consumer;
66
var stopped = false;
77

88
const kafka = new Kafka({
9-
brokers: ['<fill>'],
10-
ssl: true,
11-
connectionTimeout: 5000,
12-
sasl: {
13-
mechanism: 'plain',
14-
username: '<fill>',
15-
password: '<fill>',
16-
},
9+
brokers: ['localhost:9092'],
1710
});
1811

1912
consumer = kafka.consumer({
20-
groupId: 'test-group',
13+
groupId: 'test-group22' + Math.random(),
2114
rebalanceListener: {
2215
onPartitionsAssigned: async (assignment) => {
2316
console.log(`Assigned partitions ${JSON.stringify(assignment)}`);
@@ -33,10 +26,11 @@ async function consumerStart() {
3326
},
3427
rdKafka: {
3528
globalConfig: {
36-
'enable.auto.commit': false
29+
'debug': 'conf',
30+
'enable.auto.commit': false,
31+
'auto.offset.reset': 'error'
3732
},
3833
topicConfig: {
39-
'auto.offset.reset': 'earliest'
4034
},
4135
}
4236
});
@@ -46,7 +40,7 @@ async function consumerStart() {
4640

4741
await consumer.subscribe({
4842
topics: [
49-
"topic2"
43+
"test-topic"
5044
]
5145
})
5246

lib/kafkajs/_kafka.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class Kafka {
2727
mergedConfig.rdKafka = mergedConfig.rdKafka ?? {};
2828

2929
if (typeof config.rdKafka === 'object') {
30-
Object.assign(mergedConfig.rdKafka.globalConfig ?? {}, config.rdKafka.globalConfig ?? {});
31-
Object.assign(mergedConfig.rdKafka.topicConfig ?? {}, config.rdKafka.topicConfig ?? {});
30+
mergedConfig.rdKafka.globalConfig = Object.assign(mergedConfig.rdKafka.globalConfig ?? {}, config.rdKafka.globalConfig ?? {});
31+
mergedConfig.rdKafka.topicConfig = Object.assign(mergedConfig.rdKafka.topicConfig ?? {}, config.rdKafka.topicConfig ?? {});
3232
delete config.rdKafka;
3333
}
3434

package-lock.json

Lines changed: 24 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
"devDependencies": {
3333
"@types/node": "^20.4.5",
3434
"bluebird": "^3.5.3",
35-
"jest": "^29.7.0",
3635
"eslint": "8.54.0",
37-
"jsdoc": "^3.4.0",
36+
"jest": "^29.7.0",
37+
"jsdoc": "^4.0.2",
3838
"jshint": "^2.10.1",
3939
"mocha": "^10.2.0",
4040
"node-gyp": "^9.3.1",

0 commit comments

Comments
 (0)