Asserts a Rabbit MQ topology using the amqp.node library.
const amqp = require( "amqplib" );
const amqpTopology = require( "amqplib-topology" );
let ok = amqp.connect( rabbitUri );
ok = ok
.then( connection => {
return amqpTopology( connection ).assert( {
exchanges: {
"events": {
"type": "fanout"
}
}
} );
} )
.then( topology => console.log( "Topology created!", topology.exchanges.events ) )
.catch( err => console.error( err ) );