import { KafkaJS } from "@confluentinc/kafka-javascript"; import { ClientConfig, ProtobufDeserializerConfig, ProtobufSerializerConfig, SchemaRegistryClient } from "@confluentinc/schemaregistry"; import { DynamicModule, FactoryProvider, InjectionToken, Logger, ModuleMetadata } from "@nestjs/common"; import { ClientProxy, CustomClientOptions, CustomStrategy, CustomTransportStrategy, MsPattern, ReadPacket, Server, Transport, WritePacket } from "@nestjs/microservices"; import { Observable } from "rxjs"; import { BaseRpcContext } from "@nestjs/microservices/ctx-host/base-rpc.context"; //#region src/interfaces/kafka-admin-client-options.d.ts /** Configuration for creating a Kafka admin client within KafkaModule. */ interface KafkaAdminClientOptions$1 { autoConnect?: boolean; conf: KafkaJS.AdminConstructorConfig; } //#endregion //#region src/interfaces/kafka-consumer-options.d.ts /** Configuration for creating a Kafka consumer within KafkaModule. */ interface KafkaConsumerOptions { conf: KafkaJS.ConsumerConstructorConfig; autoConnect?: boolean; } //#endregion //#region src/interfaces/kafka-producer-options.d.ts /** Configuration for creating a Kafka producer within KafkaModule. */ interface KafkaProducerOptions { conf: KafkaJS.ProducerConstructorConfig; autoConnect?: boolean; } //#endregion //#region src/interfaces/kafka-schema-registry-options.d.ts /** Configuration for connecting to a Confluent Schema Registry. */ interface KafkaSchemaRegistryClientOptions { conf: ClientConfig; } //#endregion //#region src/interfaces/kafka-connection-options.d.ts /** Options for establishing a Kafka connection in KafkaModule. */ interface KafkaConnectionOptions { consumer?: KafkaConsumerOptions; producer?: KafkaProducerOptions; adminClient?: KafkaAdminClientOptions$1; schemaRegistry?: KafkaSchemaRegistryClientOptions; global?: boolean; } /** Async variant of {@link KafkaConnectionOptions} for factory-based configuration. */ interface KafkaConnectionAsyncOptions extends Pick { useFactory: (...args: any[]) => Promise | KafkaConnectionOptions; inject?: any[]; global?: boolean; } //#endregion //#region src/kafka.module.d.ts /** NestJS dynamic module that provides Kafka connection, producer, consumer, and admin client. */ export declare class KafkaModule { /** * Creates the connection to the kafka instance. * @param options the options for the node-rdkafka connection. * @internal */ static forRoot(options: KafkaConnectionOptions): DynamicModule; /** * Creates the connection to the kafka instance in an asynchronous fashion. * @param options the async options for the node-rdkafka connection. */ static forRootAsync(options: KafkaConnectionAsyncOptions): Promise; static loadPluginModules(): DynamicModule[]; } //#endregion //#region src/serde/kafka-serde.interface.d.ts type SerdePayload = Buffer | null | undefined; /** Serializes a value to a Buffer before sending to Kafka. */ interface KafkaSerializer { serialize(topic: string, payload: unknown, headers?: KafkaJS.IHeaders): Promise; } /** Deserializes a raw Kafka message payload into a typed value. */ interface KafkaDeserializer { deserialize(topic: string, payload: SerdePayload, headers?: KafkaJS.IHeaders): Promise; } //#endregion //#region src/serde/json.serde.d.ts /** Default serializer — encodes values as JSON strings in a UTF-8 Buffer. */ export declare class JsonKafkaSerializer implements KafkaSerializer { serialize(_topic: string, payload: unknown, _headers?: KafkaJS.IHeaders): Promise; } /** Default deserializer — decodes a UTF-8 Buffer as a JSON value. */ export declare class JsonKafkaDeserializer implements KafkaDeserializer { deserialize(_topic: string, payload: SerdePayload, _headers?: KafkaJS.IHeaders): Promise; } //#endregion //#region src/serde/protobuf.serde.d.ts /** Serializes Protobuf messages using Confluent Schema Registry wire format. */ export declare class ProtobufKafkaSerializer implements KafkaSerializer { private readonly inner; constructor(client: SchemaRegistryClient, config?: ProtobufSerializerConfig); serialize(topic: string, data: unknown, headers?: KafkaJS.IHeaders): Promise; } /** Deserializes Protobuf messages encoded in Confluent Schema Registry wire format. */ export declare class ProtobufKafkaDeserializer implements KafkaDeserializer { private readonly inner; constructor(client: SchemaRegistryClient, config?: ProtobufDeserializerConfig); deserialize(topic: string, payload: SerdePayload, headers?: KafkaJS.IHeaders): Promise; } //#endregion //#region src/utils/rdkafka-config.d.ts /** Global rdkafka connection configuration options. */ interface KafkaRdKafkaConfig { socketTimeoutMs?: number; socketKeepaliveEnable?: boolean; socketSendBufferBytes?: number; socketReceiveBufferBytes?: number; socketNagleDisable?: boolean; socketMaxFails?: number; socketConnectionSetupTimeoutMs?: number; connectionsMaxIdleMs?: number; brokerAddressTtl?: number; brokerAddressFamily?: "any" | "v4" | "v6"; reconnectBackoffMs?: number; reconnectBackoffMaxMs?: number; reconnectBackoffJitterMs?: number; messageMaxBytes?: number; messageCopyMaxBytes?: number; receiveMessageMaxBytes?: number; maxInFlight?: number; metadataMaxAgeMs?: number; topicMetadataRefreshIntervalMs?: number; topicMetadataRefreshSparse?: boolean; topicMetadataRefreshFastIntervalMs?: number; topicMetadataPropagationMaxMs?: number; metadataRecoveryStrategy?: "none" | "rebootstrap"; clientRack?: string; allowAutoCreateTopics?: boolean; debug?: string; statisticsIntervalMs?: number; enableMetricsPush?: boolean; logLevel?: number; logConnectionClose?: boolean; securityProtocol?: "plaintext" | "ssl" | "sasl_plaintext" | "sasl_ssl"; sslCaLocation?: string; sslCaPem?: string; sslCertificateLocation?: string; sslCertificatePem?: string; sslKeyLocation?: string; sslKeyPem?: string; sslKeyPassword?: string; sslCipherSuites?: string; sslCurvesList?: string; sslSigalgsList?: string; sslCrlLocation?: string; sslKeystoreLocation?: string; sslKeystorePassword?: string; enableSslCertificateVerification?: boolean; sslEndpointIdentificationAlgorithm?: "none" | "https"; saslKerberosServiceName?: string; saslKerberosPrincipal?: string; saslKerberosKinitCmd?: string; saslKerberosKeytab?: string; saslKerberosMinTimeBeforeRelogin?: number; saslOauthbearerMethod?: "default" | "oidc"; saslOauthbearerClientId?: string; saslOauthbearerClientSecret?: string; saslOauthbearerScope?: string; saslOauthbearerExtensions?: string; saslOauthbearerTokenEndpointUrl?: string; saslOauthbearerGrantType?: "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer"; saslOauthbearerSubClaimName?: string; enableSaslOauthbearerUnsecureJwt?: boolean; saslOauthbearerAssertionAlgorithm?: "RS256" | "ES256"; saslOauthbearerAssertionPrivateKeyFile?: string; saslOauthbearerAssertionPrivateKeyPassphrase?: string; saslOauthbearerAssertionPrivateKeyPem?: string; saslOauthbearerAssertionClaimAud?: string; saslOauthbearerAssertionClaimExpSeconds?: number; saslOauthbearerAssertionClaimIss?: string; saslOauthbearerAssertionClaimJtiInclude?: boolean; saslOauthbearerAssertionClaimNbfSeconds?: number; saslOauthbearerAssertionClaimSub?: string; } /** Consumer-specific rdkafka configuration options. */ interface KafkaConsumerRdKafkaConfig { groupInstanceId?: string; partitionAssignmentStrategy?: string; sessionTimeoutMs?: number; heartbeatIntervalMs?: number; groupProtocol?: "classic" | "consumer"; groupProtocolType?: string; groupRemoteAssignor?: string; coordinatorQueryIntervalMs?: number; maxPollIntervalMs?: number; autoCommitIntervalMs?: number; queuedMinMessages?: number; queuedMaxMessagesKbytes?: number; fetchWaitMaxMs?: number; fetchQueueBackoffMs?: number; fetchMessageMaxBytes?: number; fetchMaxBytes?: number; fetchMinBytes?: number; fetchErrorBackoffMs?: number; isolationLevel?: "read_uncommitted" | "read_committed"; enablePartitionEof?: boolean; checkCrcs?: boolean; autoOffsetReset?: "smallest" | "earliest" | "beginning" | "largest" | "latest" | "end" | "error"; } /** Producer-specific rdkafka configuration options. */ interface KafkaProducerRdKafkaConfig { transactionalId?: string; transactionTimeoutMs?: number; enableIdempotence?: boolean; enableGaplessGuarantee?: boolean; queueBufferingMaxMessages?: number; queueBufferingMaxKbytes?: number; lingerMs?: number; messageSendMaxRetries?: number; compressionCodec?: "none" | "gzip" | "snappy" | "lz4" | "zstd"; batchNumMessages?: number; batchSize?: number; stickyPartitioningLingerMs?: number; deliveryReportOnlyError?: boolean; messageTimeoutMs?: number; requestTimeoutMs?: number; requestRequiredAcks?: number; } //#endregion //#region src/types/kafka.types.d.ts /** KafkaJS consumer instance. */ type KafkaConsumer = KafkaJS.Consumer; /** KafkaJS producer instance. */ type KafkaProducer = KafkaJS.Producer; /** A single Kafka message as provided by KafkaJS. */ type KafkaMessage = KafkaJS.KafkaMessage; /** Normalised Kafka headers as a string-to-string map. */ type KafkaHeaders = Map; /** Function that commits the current message offset. */ type KafkaAck = () => Promise; /** Function that triggers a retry, optionally after a delay. */ type KafkaNack = (delayMs?: number) => void; /** Possible shapes for a Kafka message key. */ type KafkaKey = Record | string | null; /** Lifecycle status of a Kafka transport or client. */ export declare enum KafkaStatus { CONNECTED = "connected", DISCONNECTED = "disconnected", FAILED = "failed" } /** Retry with a constant delay between attempts. */ interface FixedRetryStrategy { type: "fixed"; /** Delay between retries in ms. Defaults to 5000. */ delayMs?: number; /** Maximum number of retries before sending to DLQ. Defaults to Infinity. */ maxRetries?: number; } /** Retry with exponentially increasing delays, with an optional jitter. */ interface ExponentialRetryStrategy { type: "exponential"; /** Initial delay in ms. Defaults to 1000. */ initialDelayMs?: number; /** Multiplier applied to the delay on each attempt. Defaults to 2. */ multiplier?: number; /** Upper bound for the computed delay in ms. Defaults to 30000. */ maxDelayMs?: number; /** When true, applies full jitter (uniform random between 0 and computed delay). */ jitter?: boolean; /** Maximum number of retries before sending to DLQ. Defaults to Infinity. */ maxRetries?: number; } /** Configures how failed messages are retried before going to the DLQ. */ type KafkaRetryStrategy = FixedRetryStrategy | ExponentialRetryStrategy; /** Map of Kafka topic names to their event payload types. Used to type `KafkaClient`. */ type KafkaTopicMap = Record; /** Options passed to the KafkaJS-based strategy and client. */ interface KafkaOptions { brokers: string[]; clientId?: string; groupId: string; /** Suffix appended to clientId and groupId. Defaults to "-server" in KafkaStrategy and "-client" in KafkaClient. */ postfixId?: string; ssl?: boolean; sasl?: KafkaJS.SASLOptions; consumer?: Partial; consumerRdKafka?: KafkaConsumerRdKafkaConfig; producer?: Partial; producerRdKafka?: KafkaProducerRdKafkaConfig; rdKafka?: KafkaRdKafkaConfig; producerOnlyMode?: boolean; /** Retry strategy for failed messages. Defaults to fixed 5000 ms delay with infinite retries. */ retryStrategy?: KafkaRetryStrategy; deadLetterTopic?: string; shutdownTimeoutMs?: number; handlerTimeoutMs?: number; /** Auto-creates subscribed topics before the consumer starts. Enabled by default with broker defaults; pass an object to set numPartitions/replicationFactor, or false to disable. */ autoCreateTopics?: Omit | false; /** When true, consumer runs in eachBatch mode instead of eachMessage. */ batchMode?: boolean; /** Options forwarded to consumer.run() — excludes eachMessage/eachBatch which are managed internally. */ consumerRun?: Omit; /** Custom serializer for outgoing message values. Defaults to JSON. */ serializer?: KafkaSerializer; /** Custom deserializer for incoming message values. Defaults to JSON. */ deserializer?: KafkaDeserializer; } /** * Structured payload for `emit()` calls. * Use `value` to send one message or `values` to fan-out into multiple messages * that all share the same `key` and `headers`. */ interface KafkaEmitPayload { /** Message key, shared by all produced messages. */ key?: Buffer | string | null; /** Target partition, shared by all produced messages. */ partition?: number; /** Single message value. */ value?: T; /** Multiple message values — one Kafka message is produced per element. */ values?: T[]; /** Headers attached to every produced message. */ headers?: KafkaJS.IHeaders; } /** A Kafka message with its key and value already deserialised. */ interface ParsedKafkaMessage { key: unknown; value: unknown; offset: string; timestamp: string; headers: Map; } //#endregion //#region src/context/kafka.context.d.ts type KafkaContextArgs = [message: KafkaJS.KafkaMessage, partition: number, topic: string, key: KafkaKey, headers: KafkaHeaders, nack: KafkaNack]; /** RPC execution context that exposes typed Kafka message fields. */ export declare class KafkaContext extends BaseRpcContext { constructor(message: KafkaJS.KafkaMessage, partition: number, topic: string, headers: KafkaJS.IHeaders | undefined, nack: (delayMs?: number) => void); getMessage(): KafkaJS.KafkaMessage; getPartition(): number; getTopic(): string; getKey(): KafkaKey; getHeaders(): KafkaHeaders; commit(): Promise; nack(delayMs?: number): void; } //#endregion //#region src/strategy/kafka.strategy.d.ts /** NestJS custom transport strategy backed by rdkafka via KafkaJS. */ export declare class KafkaStrategy extends Server implements CustomTransportStrategy { private readonly options; readonly transportId = Transport.KAFKA; protected readonly logger: Logger; private consumer; private producer; private commitTimer; private pendingOffsets; private failureCounts; private closed; private reconnecting; private rebalancing; private generation; private currentStatus; private readonly kafkaSerializer; private readonly kafkaDeserializer; constructor(options: KafkaOptions); private kafkaSerialize; private kafkaDeserialize; getStatus(): KafkaStatus; listen(callback: (err?: unknown) => void): Promise; private connect; private scheduleReconnect; close(): Promise; private disconnectClients; on void>(_event: EventKey, _callback: EventCallback): void; unwrap(): T; private createKafka; private processMessage; private withHandlerTimeout; private getRetryOverrides; private handleEventMessage; handleEvent(pattern: string, packet: { pattern: string; data: unknown; }, context: KafkaContext): Promise; private handleRpcMessage; private storeOffset; private sendToDlq; private sendReply; private combineStreamsAndThrowIfRetriable; } //#endregion //#region src/constants/kafka.constants.d.ts /** Transport identifier for the rdkafka-based Kafka strategy. */ export declare const RDKAFKA_TRANSPORT: unique symbol; /** Default injection token for a {@link KafkaClient} registered via {@link KafkaClientsModule}. */ export declare const KAFKA_CLIENT_TOKEN: unique symbol; /** Default injection token for a `KafkaJS.Admin` registered via {@link KafkaAdminModule}. */ export declare const KAFKA_ADMIN_TOKEN: unique symbol; //#endregion //#region src/errors/kafka-handler-timeout.error.d.ts export declare class KafkaHandlerTimeoutError extends Error { readonly topic: string; readonly partition: number; readonly offset: string; readonly timeoutMs: number; constructor(topic: string, partition: number, offset: string, timeoutMs: number); } //#endregion //#region src/health/kafka-health.indicator.d.ts /** Any Kafka transport or client that can report its current status. */ interface KafkaHealthCheckable { getStatus(): KafkaStatus; } export declare class KafkaHealthIndicator { isHealthy(kafkaKey: string, provider: KafkaHealthCheckable): Promise<{ [key: string]: { status: string; }; }>; } //#endregion //#region src/providers/kafka.metrics.d.ts type KafkaTopicMetrics = Record; type KafkaPartitionMetrics = Record; /** Per-partition consumer lag and offset information. */ interface KafkaMetrics { lag?: number; consumerOffset?: number; producerOffset?: number; } /** Service for collecting consumer lag and offset metrics via the Kafka admin client. */ export declare class KafkaMetricsService { private readonly admin?; private readonly groupId?; constructor(admin?: KafkaJS.Admin | undefined, groupId?: string | undefined); getMetrics(): Promise; private evaluateLag; private populateConsumerOffsetForTopic; private populateProducerOffsetForTopic; private checkPrerequisites; } //#endregion //#region src/providers/kafka.admin.d.ts type FetchConsumerOffsetsOptions = { timeout?: number; requireStableOffsets?: boolean; }; /** Injectable service for Kafka admin operations: topic management, offset inspection, and group control. */ export declare class KafkaAdminService { private readonly admin?; constructor(admin?: KafkaJS.Admin | undefined); private getAdmin; /** Lists all topic names available in the cluster. */ listTopics(options?: { timeout?: number; }): Promise; /** Creates one or more topics. Returns true if topics were created. */ createTopics(topics: KafkaJS.ITopicConfig[], options?: { validateOnly?: boolean; waitForLeaders?: boolean; timeout?: number; }): Promise; /** Deletes one or more topics by name. */ deleteTopics(topics: string[], options?: { timeout?: number; }): Promise; /** Returns metadata for the given topics (or all topics if none specified). */ fetchTopicMetadata(options?: { topics?: string[]; includeAuthorizedOperations?: boolean; timeout?: number; }): Promise; /** Returns the current high/low watermark offsets for each partition of the given topic. */ fetchTopicOffsets(topic: string, options?: { timeout?: number; isolationLevel: KafkaJS.IsolationLevel; }): Promise>; /** Returns offsets for each partition at the given timestamp. */ fetchTopicOffsetsByTimestamp(topic: string, timestamp?: number, options?: { timeout?: number; isolationLevel: KafkaJS.IsolationLevel; }): Promise; /** Returns the committed consumer offsets for a group, optionally filtered by topics. */ fetchConsumerOffsets(groupId: string, topics?: string[], options?: FetchConsumerOffsetsOptions): Promise>; /** Deletes records from topic partitions up to the given offsets. */ deleteTopicRecords(options: { topic: string; partitions: KafkaJS.SeekEntry[]; timeout?: number; operationTimeout?: number; }): Promise; /** Lists all consumer groups in the cluster. */ listGroups(options?: { timeout?: number; matchConsumerGroupStates?: KafkaJS.ConsumerGroupStates[]; matchConsumerGroupTypes?: KafkaJS.ConsumerGroupTypes[]; }): Promise<{ groups: KafkaJS.GroupOverview[]; errors: KafkaJS.LibrdKafkaError[]; }>; /** Returns detailed information about the specified consumer groups. */ describeGroups(groups: string[], options?: { timeout?: number; includeAuthorizedOperations?: boolean; }): Promise; /** Deletes the specified consumer groups. */ deleteGroups(groupIds: string[], options?: { timeout?: number; }): Promise; } //#endregion //#region src/admin/kafka-admin.module.d.ts /** Options for creating a standalone Kafka admin client. */ interface KafkaAdminOptions { brokers: string[]; clientId?: string; ssl?: boolean; sasl?: KafkaJS.SASLOptions; rdKafka?: KafkaRdKafkaConfig; } /** Options for registering a named Kafka admin client synchronously. */ interface KafkaAdminClientOptions { name: InjectionToken; options: KafkaAdminOptions; } /** Options for registering a named Kafka admin client asynchronously via a factory. */ interface KafkaAdminClientAsyncOptions extends Pick { name: InjectionToken; useFactory: (...args: unknown[]) => KafkaAdminOptions | Promise; inject?: InjectionToken[]; } /** NestJS module for registering one or more named `KafkaJS.Admin` instances. */ export declare class KafkaAdminModule { static register(clients: KafkaAdminClientOptions[]): DynamicModule; static registerAsync(clients: KafkaAdminClientAsyncOptions[]): DynamicModule; } //#endregion //#region src/client/kafka.client.d.ts /** NestJS ClientProxy implementation for sending messages and events over Kafka. */ export declare class KafkaClient extends ClientProxy, KafkaStatus> { protected readonly options: KafkaOptions; protected readonly logger: Logger; protected responsePatterns: string[]; protected consumerAssignments: Record; private _consumer; private _producer; private connected; private readonly kafkaSerializer; private readonly kafkaDeserializer; constructor(options: KafkaOptions); get producer(): KafkaJS.Producer; getStatus(): KafkaStatus; subscribeToResponseOf(pattern: unknown): void; connect(): Promise; close(): Promise; on(_event: string | number | symbol, _callback: (...args: unknown[]) => void): void; unwrap(): T; emitBatch(pattern: MsPattern, data: { messages: TInput[]; }): Observable; protected dispatchEvent(packet: ReadPacket): Promise; protected dispatchBatchEvent(packets: ReadPacket<{ messages: unknown[]; }>): Promise; protected publish(partialPacket: ReadPacket, callback: (packet: WritePacket) => void): () => void; private handleResponseMessage; private deserializeResponse; protected getResponsePatternName(pattern: string): string; protected getReplyTopicPartition(topic: string): string; private createKafka; } /** Typed version of {@link KafkaClient} with narrowed `emit` and `send` signatures. Use as the injection type instead of the raw class. */ type KafkaClientProxy = Omit & { emit(pattern: string, data: KafkaEmitPayload | Record): Observable; send(pattern: string, data: unknown): Observable; }; //#endregion //#region src/client/kafka-clients.module.d.ts /** Options for registering a named Kafka client synchronously. */ interface KafkaClientOptions { name: InjectionToken; options: KafkaOptions; } /** Options for registering a named Kafka client asynchronously via a factory. */ interface KafkaClientAsyncOptions extends Pick { name: InjectionToken; useFactory: (...args: unknown[]) => KafkaOptions | Promise; inject?: InjectionToken[]; extraProviders?: FactoryProvider[]; } export declare class KafkaClientsModule { static register(clients: KafkaClientOptions[]): DynamicModule; static registerAsync(clients: KafkaClientAsyncOptions[]): DynamicModule; } //#endregion //#region src/config/kafka-microservice.config.d.ts /** Configuration passed to {@link createKafkaMicroservice}. */ interface KafkaConnectConfig { options: KafkaOptions; } /** Creates a NestJS {@link CustomStrategy} backed by {@link KafkaStrategy}. */ export declare const createKafkaMicroservice: (config: KafkaConnectConfig) => CustomStrategy; //#endregion //#region src/config/kafka-client-broker.config.d.ts /** Creates a {@link CustomClientOptions} object that wires up {@link KafkaClient} as the transport. */ export declare const createKafkaClientBroker: (options: KafkaOptions) => CustomClientOptions; //#endregion //#region src/decorators/kafka.decorators.d.ts /** Injects the deserialized Kafka message key into a handler parameter. */ export declare const KafkaMessageKey: (...dataOrPipes: unknown[]) => ParameterDecorator; /** Injects the Kafka message headers map into a handler parameter. */ export declare const KafkaMessageHeaders: (...dataOrPipes: unknown[]) => ParameterDecorator; /** Injects a single Kafka message header value by name into a handler parameter. */ export declare const KafkaMessageHeader: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform | import("@nestjs/common").Type>)[]) => ParameterDecorator; /** Injects the Kafka topic name into a handler parameter. */ export declare const KafkaMessageTopic: (...dataOrPipes: unknown[]) => ParameterDecorator; /** Injects the Kafka partition number into a handler parameter. */ export declare const KafkaMessagePartition: (...dataOrPipes: unknown[]) => ParameterDecorator; /** Injects the commit function for manual offset acknowledgement into a handler parameter. */ export declare const KafkaMessageAck: (...dataOrPipes: unknown[]) => ParameterDecorator; /** Injects the nack function for triggering a retry into a handler parameter. */ export declare const KafkaMessageNack: (...dataOrPipes: unknown[]) => ParameterDecorator; //#endregion //#region src/decorators/kafka-retry.decorator.d.ts /** Per-handler override for retry/DLQ behaviour, otherwise inherited from `KafkaOptions`. */ interface KafkaRetryOptions { /** Retry strategy for this handler. Overrides the module-level `retryStrategy`. */ strategy?: KafkaRetryStrategy; /** Maximum number of retries before sending to DLQ. Overrides `strategy.maxRetries` and the module-level default. */ maxRetries?: number; /** DLQ topic for this handler. Overrides the module-level `deadLetterTopic`. Pass `false` to drop the message instead of publishing to any DLQ. */ deadLetterTopic?: string | false; } /** * Overrides retry/DLQ behaviour for a single `@EventPattern` handler, e.g. to drop * messages after fewer failures than the module-wide default. * * Must be applied together with `@EventPattern` on the same method (order does not matter). * * @example * ```ts * @EventPattern("orders.created") * @KafkaRetry({ maxRetries: 3, deadLetterTopic: "orders.dlq" }) * async handleOrder(@Payload() data: Order) { ... } * ``` */ export declare const KafkaRetry: (options: KafkaRetryOptions) => MethodDecorator; //#endregion //#region src/decorators/kafka-inject.decorators.d.ts /** Injects the raw KafkaJS producer instance provided by KafkaModule. */ export declare const InjectKafkaProducer: () => PropertyDecorator & ParameterDecorator; /** Injects the raw KafkaJS consumer instance provided by KafkaModule. */ export declare const InjectKafkaConsumer: () => PropertyDecorator & ParameterDecorator; /** Injects the `KafkaJS.Admin` registered under {@link KAFKA_ADMIN_TOKEN} via {@link KafkaAdminModule}. */ export declare const InjectKafkaAdmin: () => PropertyDecorator & ParameterDecorator; /** Injects the KafkaConnectionOptions configuration object provided by KafkaModule. */ export declare const InjectKafkaConfig: () => PropertyDecorator & ParameterDecorator; /** Injects the SchemaRegistryClient instance provided by KafkaModule. */ export declare const InjectSchemaRegistry: () => PropertyDecorator & ParameterDecorator; /** Injects the {@link KafkaClient} registered under the default {@link KAFKA_CLIENT_TOKEN}. */ export declare const InjectKafkaClient: () => PropertyDecorator & ParameterDecorator; //#endregion export type { ExponentialRetryStrategy, FixedRetryStrategy, KafkaAck, KafkaAdminClientAsyncOptions, KafkaAdminClientOptions, KafkaAdminOptions, KafkaClientAsyncOptions, KafkaClientOptions, KafkaClientProxy, KafkaConnectConfig, KafkaConnectionAsyncOptions, KafkaConnectionOptions, KafkaConsumer, KafkaDeserializer, KafkaEmitPayload, KafkaHeaders, KafkaHealthCheckable, KafkaKey, KafkaMessage, KafkaMetrics, KafkaNack, KafkaOptions, KafkaProducer, KafkaRetryOptions, KafkaRetryStrategy, KafkaSerializer, KafkaTopicMap, ParsedKafkaMessage }; //# sourceMappingURL=index.d.mts.map