@nestjstools/messaging-amazon-sqs-extension 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,7 +97,22 @@ export class CreateUserHandler implements IMessageHandler<CreateUser>{
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
```
|
|
100
|
+
## 📨 Communicating Beyond a NestJS Application (Cross-Language Messaging)
|
|
100
101
|
|
|
102
|
+
### To enable communication with a Handler from services written in other languages, follow these steps:
|
|
103
|
+
|
|
104
|
+
1. **Publish a Message to the queue**
|
|
105
|
+
|
|
106
|
+
2. **Include the Routing Key Header**
|
|
107
|
+
Your message **must** include a header attribute named `messagingRoutingKey`.
|
|
108
|
+
The value should correspond to the routing key defined in your NestJS message handler:
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
@MessageHandler('my_app_command.create_user') // <-- Use this value as the routing key
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
3. **You're Done!**
|
|
115
|
+
Once the message is published with the correct routing key, it will be automatically routed to the appropriate handler within the NestJS application.
|
|
101
116
|
---
|
|
102
117
|
|
|
103
118
|
### Key Features:
|
package/package.json
CHANGED