Assim que adicionei a useFactory nas configs do routes.module.ts, recebi o seguinte erro:
`| [Nest] 124 - 06/29/2022, 8:34:25 PM ERROR [ClientKafka] ERROR [BrokerPool] Failed to connect to seed broker, trying another broker from the list: Connection error: connect ECONNREFUSED 172.17.0.1:9094 {"timestamp":"2022-06-29T20:34:25.980Z","logger":"kafkajs","retryCount":5,"retryTime":9204}
app_1 | (node:124) UnhandledPromiseRejectionWarning: KafkaJSNonRetriableError
app_1 | Caused by: KafkaJSConnectionError: Connection error: connect ECONNREFUSED 172.17.0.1:9094
app_1 | at Socket.onError (/home/node/app/node_modules/kafkajs/src/network/connection.js:210:23)
app_1 | at Socket.emit (events.js:210:5)
app_1 | at emitErrorNT (internal/streams/destroy.js:92:8)
app_1 | at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
app_1 | at processTicksAndRejections (internal/process/task_queues.js:80:21)
app_1 | (node:124) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
app_1 | (node:124) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`
Meu repo do projeto: https://github.com/AndreCosta101/nest-api