-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: unabled initialize consumer with named kafka connection
- Loading branch information
1 parent
bbc834f
commit aee4c5c
Showing
7 changed files
with
49 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export interface KafkaConsumeMetadata { | ||
topic: string | ||
topics: (string | RegExp)[] | ||
json?: boolean | ||
fromBeginning?: boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export interface KafkaConsumeOptions { | ||
json?: boolean | ||
} | ||
import { KafkaConsumeMetadata } from './kafka-consume-metadata.interface.js' | ||
|
||
|
||
export type KafkaConsumeOptions = Omit<KafkaConsumeMetadata, 'topics'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { InjectionToken, ModuleMetadata, OptionalFactoryDependency } from '@nestjs/common' | ||
import { InjectionToken, OptionalFactoryDependency, Type } from '@nestjs/common' | ||
import { KafkaModuleOptions } from './kafka-module-options.interface' | ||
|
||
|
||
export interface KafkaModuleOptionsAsync extends Pick<ModuleMetadata, 'imports'> { | ||
export interface KafkaModuleOptionsAsync { | ||
/** | ||
* @default "default" | ||
*/ | ||
name?: string | ||
useFactory: (...args: any[]) => Promise<KafkaModuleOptions> | KafkaModuleOptions | ||
useClass?: Type<KafkaModuleOptions> | ||
useExisting?: Type<KafkaModuleOptions> | ||
useFactory?: (...args: any[]) => Promise<KafkaModuleOptions> | KafkaModuleOptions | ||
inject?: Array<InjectionToken | OptionalFactoryDependency> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function getAsyncOptionsProvideName(name?: string): string { | ||
return `KafkaAsyncOptions.${name || 'default'}` | ||
} |