@ccci/micro-server 1.0.158 → 1.0.159
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 +47255 -46550
- package/dist/utils/KafkaServer.d.ts +34 -0
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ApplicationOptionType } from '@/types/ApplicationOptionType';
|
|
2
|
+
/**
|
|
3
|
+
* KafkaServer class to manage Kafka consumers and producers.
|
|
4
|
+
* It automatically loads and starts consumers and producers from specified directories.
|
|
5
|
+
*/
|
|
6
|
+
export declare class KafkaServer {
|
|
7
|
+
private consumersPath;
|
|
8
|
+
private producersPath;
|
|
9
|
+
private consumers;
|
|
10
|
+
private producers;
|
|
11
|
+
private kafkaBroker;
|
|
12
|
+
/**
|
|
13
|
+
* @param config - Configuration for Kafka.
|
|
14
|
+
*/
|
|
15
|
+
constructor(config: ApplicationOptionType);
|
|
16
|
+
/**
|
|
17
|
+
* Starts all consumers automatically by dynamically importing and instantiating consumer classes
|
|
18
|
+
* from the specified consumers directory.
|
|
19
|
+
* Each consumer is connected with a clientId and groupId generated from the file name.
|
|
20
|
+
*/
|
|
21
|
+
startConsumers(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Starts all producers automatically by dynamically importing and instantiating producer classes
|
|
24
|
+
* from the specified producers directory.
|
|
25
|
+
* Each producer is connected with a clientId generated from the file name.
|
|
26
|
+
*/
|
|
27
|
+
startProducers(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Disconnects all consumers and producers.
|
|
30
|
+
* This method ensures that all active consumers and producers are disconnected.
|
|
31
|
+
*/
|
|
32
|
+
disconnectAll(): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=KafkaServer.d.ts.map
|