Skip to content

Commit e1bd5bb

Browse files
authored
docs(Kafka): adding postfixId property in kafka client options
When I was getting some error logs trying connect to the kafka server, I saw that the library added a "-server" or "-client" suffix to the value of the clientId property. Well, in the documentation there is a very generic "HINT" on how to change this... "Kafka client and consumer naming conventions can be customized by extending ClientKafka and KafkaServer in your own custom provider and overriding the constructor." But looking at node_modules i found a property called "posfixId" in the file responsible for initializing the connection to the kafka server, which appeared to be responsible for prefixing of clientId value, so I put this setting in my configuration object in main.ts with an empty value, like ''. And it worked fine (the suffix was removed), so i think it would be nice to make it clear that this configuration exists, after all, some Kafka servers need a specific clientId where the value cannot be changed in any way. You can see this property in https://github.com/nestjs/nest/blob/master/packages/microservices/server/server-kafka.ts line 60. So, in conclusion, I'm proposing to put this as one more property in the "Options" object section.
1 parent b917050 commit e1bd5bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

content/microservices/kafka.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ The `options` property is specific to the chosen transporter. The <strong>Kafka<
112112
<td><code>producerOnlyMode</code></td>
113113
<td>Feature flag to skip consumer group registration and only act as a producer (<code>boolean</code>)</td>
114114
</tr>
115+
<tr>
116+
<td><code>postfixId</code></td>
117+
<td>Change suffix of clientId value (<code>string</code>)</td>
118+
</tr>
115119
</table>
116120

117121
#### Client

0 commit comments

Comments
 (0)