const rabbitMq = new SimpleExternalRabbitMQ('notification-service');
const messages = [
{
userID: 2344,
message: "Hello, Ivan"
},
{
userID: 7444,
message: "Hello, Petr"
}
];
rabbitMq.publishMultipleMessages(
'push-notifications',
messages.map(m => JSON.stringify(m)),
{
ContentType: "application/json",
Headers: {
"X-Source": "simple"
}
}
)
ss.info(rabbitMq.getErrors());