Initial project structure
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import * as amqp from "amqplib";
|
||||
|
||||
|
||||
export class CommandService {
|
||||
|
||||
|
||||
constructor(
|
||||
private channel: amqp.Channel
|
||||
){}
|
||||
|
||||
|
||||
|
||||
async send(
|
||||
queue:string,
|
||||
command:any
|
||||
){
|
||||
|
||||
|
||||
await this.channel.sendToQueue(
|
||||
|
||||
queue,
|
||||
|
||||
Buffer.from(
|
||||
JSON.stringify(command)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
|
||||
console.log(
|
||||
"Command gesendet:",
|
||||
command
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user