Skip to content

Commit 431a3bf

Browse files
authored
docs(microservices) clarify applicability of @MessagePattern decorator
1 parent 4e4050a commit 431a3bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/microservices/basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ The request-response message style is useful when you need to **exchange** messa
9797

9898
To enable the request-response message type, Nest creates two logical channels - one is responsible for transferring the data while the other waits for incoming responses. For some underlying transports, such as [NATS](https://nats.io/), this dual-channel support is provided out-of-the-box. For others, Nest compensates by manually creating separate channels. There can be overhead for this, so if you do not require a request-response message style, you should consider using the event-based method.
9999

100-
To create a message handler based on the request-response paradigm use the `@MessagePattern()` decorator, which is imported from the `@nestjs/microservices` package.
100+
To create a message handler based on the request-response paradigm use the `@MessagePattern()` decorator, which is imported from the `@nestjs/microservices` package. This decorator is only registered for [controllers](https://docs.nestjs.com/controllers) since they are the entry points for your application: it would be bad practice to distribute `@MessagePattern()` decorators throughout the application code.
101101

102102
```typescript
103103
@@filename(math.controller)

0 commit comments

Comments
 (0)