diff --git a/packages/microservices/client/client-kafka.ts b/packages/microservices/client/client-kafka.ts index 7aac2451f5f..ba9ad099a33 100644 --- a/packages/microservices/client/client-kafka.ts +++ b/packages/microservices/client/client-kafka.ts @@ -62,7 +62,7 @@ export class ClientKafka extends ClientProxy { const consumerOptions = this.getOptionsProp(this.options, 'consumer') || ({} as ConsumerConfig); const postfixId = - this.getOptionsProp(this.options, 'postfixId') || '-client'; + this.getOptionsProp(this.options, 'postfixId') ?? '-client'; this.producerOnlyMode = this.getOptionsProp(this.options, 'producerOnlyMode') || false; diff --git a/packages/microservices/interfaces/microservice-configuration.interface.ts b/packages/microservices/interfaces/microservice-configuration.interface.ts index 298115b06a8..f167a414ce7 100644 --- a/packages/microservices/interfaces/microservice-configuration.interface.ts +++ b/packages/microservices/interfaces/microservice-configuration.interface.ts @@ -191,6 +191,9 @@ export interface KafkaParserConfig { export interface KafkaOptions { transport?: Transport.KAFKA; options?: { + /** + * Defaults to `"-server"` on server side and `"-client"` on client side. + */ postfixId?: string; client?: KafkaConfig; consumer?: ConsumerConfig; diff --git a/packages/microservices/server/server-kafka.ts b/packages/microservices/server/server-kafka.ts index 880af956dd1..2a426eaf673 100644 --- a/packages/microservices/server/server-kafka.ts +++ b/packages/microservices/server/server-kafka.ts @@ -57,7 +57,7 @@ export class ServerKafka extends Server implements CustomTransportStrategy { const consumerOptions = this.getOptionsProp(this.options, 'consumer') || ({} as ConsumerConfig); const postfixId = - this.getOptionsProp(this.options, 'postfixId') || '-server'; + this.getOptionsProp(this.options, 'postfixId') ?? '-server'; this.brokers = clientOptions.brokers || [KAFKA_DEFAULT_BROKER];