@ccci/micro-server 1.0.190 → 1.0.191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -6
- package/dist/utils/BaseConsumer.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -304122,17 +304122,17 @@ class BaseConsumer {
|
|
|
304122
304122
|
this.consumer = null;
|
|
304123
304123
|
}
|
|
304124
304124
|
}
|
|
304125
|
-
async subscribe(topic,
|
|
304125
|
+
async subscribe(topic, messageHandler, consumerRunConfig) {
|
|
304126
304126
|
if (!this.consumer) {
|
|
304127
304127
|
throw new Error("Consumer not connected");
|
|
304128
304128
|
}
|
|
304129
304129
|
await this.consumer.subscribe({ topic, fromBeginning: true });
|
|
304130
304130
|
await this.consumer.run({
|
|
304131
|
-
autoCommit,
|
|
304132
|
-
autoCommitInterval,
|
|
304133
|
-
autoCommitThreshold,
|
|
304134
|
-
eachBatchAutoResolve,
|
|
304135
|
-
partitionsConsumedConcurrently,
|
|
304131
|
+
autoCommit: consumerRunConfig?.autoCommit,
|
|
304132
|
+
autoCommitInterval: consumerRunConfig?.autoCommitInterval,
|
|
304133
|
+
autoCommitThreshold: consumerRunConfig?.autoCommitThreshold,
|
|
304134
|
+
eachBatchAutoResolve: consumerRunConfig?.eachBatchAutoResolve,
|
|
304135
|
+
partitionsConsumedConcurrently: consumerRunConfig?.partitionsConsumedConcurrently,
|
|
304136
304136
|
eachMessage: async ({ topic: topic2, partition, message }) => {
|
|
304137
304137
|
const parsedMessage = {
|
|
304138
304138
|
headers: message.headers,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Consumer, type ConsumerConfig } from "kafkajs";
|
|
1
|
+
import { ConsumerRunConfig, type Consumer, type ConsumerConfig } from "kafkajs";
|
|
2
2
|
import { BaseKafka } from "./BaseKafka";
|
|
3
3
|
import type { MessageHandler } from "../types/BrokerType";
|
|
4
4
|
/**
|
|
@@ -39,6 +39,6 @@ export declare class BaseConsumer {
|
|
|
39
39
|
* @returns {Promise<void>} - A promise that resolves once the consumer has successfully subscribed and started processing messages.
|
|
40
40
|
* @throws {Error} - Throws an error if the consumer is not connected before subscribing.
|
|
41
41
|
*/
|
|
42
|
-
subscribe(topic: string,
|
|
42
|
+
subscribe(topic: string, messageHandler: MessageHandler, consumerRunConfig?: ConsumerRunConfig): Promise<void>;
|
|
43
43
|
}
|
|
44
44
|
//# sourceMappingURL=BaseConsumer.d.ts.map
|