mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-17 13:24:56 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
17
examples/mq/publish/node/publishAMessage.js
Executable file
17
examples/mq/publish/node/publishAMessage.js
Executable file
@@ -0,0 +1,17 @@
|
||||
const { MqService } = require("m3o/mq");
|
||||
|
||||
// Publish a message to the mq. Specify a topic to group messages for a specific topic.
|
||||
async function publishAmessage() {
|
||||
let mqService = new MqService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await mqService.publish({
|
||||
message: {
|
||||
id: "1",
|
||||
type: "signup",
|
||||
user: "john",
|
||||
},
|
||||
topic: "events",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
publishAmessage();
|
||||
Reference in New Issue
Block a user