wrappers/tests/testBroker.js

27 lines
582 B
JavaScript
Raw Normal View History

2023-07-03 15:33:39 +02:00
import { MessageBroker } from '../build/esm/index.js';
const broker = new MessageBroker({
createLogger: () =>
{
return {
debug: console.log,
info: console.log,
status: console.log,
warn: console.log,
error: console.error
};
}
}, {
load: true,
host: 'rabbitmq-01.stylis.local',
user: 'stylis',
pass: 'RrwJyrfeXFMimDH3hjZ5xSreMAmXtQJj',
vhost: 'development',
port: 5672
});
await broker.init();
broker.subscribe('chatlogs', (message) =>
{
console.log(message);
});