Skip to content

Commit

Permalink
docs: notice about the right order of startAllMicroservices and `li…
Browse files Browse the repository at this point in the history
…sten`
  • Loading branch information
vglebovich-lmru committed Sep 3, 2024
1 parent f468532 commit d6cc6af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ export class InfrastructureModule {
<details>
<summary>5. Connect microservice to start consuming messages</summary>

> [!IMPORTANT]
> Put `app.startAllMicroservices()` after `app.listen(...)`
```typescript
import { KafkaConsumer, KafkaRetryConsumer } from "@byndyusoft/nest-kafka";
import { MicroserviceOptions } from "@nestjs/microservices";
Expand All @@ -329,6 +332,8 @@ async function bootstrap(): Promise<void> {
await app.startAllMicroservices();

// ...

await app.listen(...)
}

// ...
Expand Down

0 comments on commit d6cc6af

Please sign in to comment.