@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 CHANGED
@@ -304122,17 +304122,17 @@ class BaseConsumer {
304122
304122
  this.consumer = null;
304123
304123
  }
304124
304124
  }
304125
- async subscribe(topic, autoCommit, autoCommitInterval, autoCommitThreshold, eachBatchAutoResolve, partitionsConsumedConcurrently, messageHandler) {
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, autoCommit?: boolean, autoCommitInterval?: number | null, autoCommitThreshold?: number | null, eachBatchAutoResolve?: boolean, partitionsConsumedConcurrently?: number, messageHandler?: MessageHandler): Promise<void>;
42
+ subscribe(topic: string, messageHandler: MessageHandler, consumerRunConfig?: ConsumerRunConfig): Promise<void>;
43
43
  }
44
44
  //# sourceMappingURL=BaseConsumer.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.190",
3
+ "version": "1.0.191",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",