Skip to content

Commit

Permalink
Merge pull request #9681 from micalevisk/fix-issue-9677
Browse files Browse the repository at this point in the history
fix(microservices): allow `postfixId` on `KafkaOptions` to be an empty string
  • Loading branch information
kamilmysliwiec committed Jun 15, 2022
2 parents 42a538e + 1e5f548 commit e3ddfaf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/microservices/client/client-kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/microservices/server/server-kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit e3ddfaf

Please sign in to comment.