@nestjstools/messaging-google-pubsub-extension 1.0.1 → 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 +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -109,6 +109,24 @@ export class CreateUserHandler implements IMessageHandler<CreateUser>{
|
|
|
109
109
|
* Easily configure projectId, topicName, and subscriptionName for full control over Pub/Sub setup.
|
|
110
110
|
---
|
|
111
111
|
|
|
112
|
+
## 📨 Communicating Beyond a NestJS Application (Cross-Language Messaging)
|
|
113
|
+
|
|
114
|
+
### To enable communication with a Handler from services written in other languages, follow these steps:
|
|
115
|
+
|
|
116
|
+
1. **Publish a Message to the Topic**
|
|
117
|
+
|
|
118
|
+
2. **Include the Routing Key Header**
|
|
119
|
+
Your message **must** include a header attribute named `messaging-routing-key`.
|
|
120
|
+
The value should correspond to the routing key defined in your NestJS message handler:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
@MessageHandler('my_app_command.create_user') // <-- Use this value as the routing key
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
3. **You're Done!**
|
|
127
|
+
Once the message is published with the correct routing key, it will be automatically routed to the appropriate handler within the NestJS application.
|
|
128
|
+
---
|
|
129
|
+
|
|
112
130
|
## Configuration options
|
|
113
131
|
|
|
114
132
|
### GooglePubSubChannel
|
package/package.json
CHANGED