UNPKG

518 BJavaScriptView Raw
1var AMQPHutch = require('../');
2
3var hutch = new AMQPHutch();
4
5var options = {
6 exchange: {
7 name: 'example.exchange.1',
8 type: 'topic'
9 },
10 queue: {
11 name: 'example.queue',
12 prefetch: 1,
13 durable: true
14 },
15 publish: {
16 persistent: true,
17 expiration: 86400000
18 }
19};
20
21hutch.initialise({
22 connectionString: 'amqp://bad',
23 retryWait: 100
24});
25
26hutch.publish(options, "Example Message!", function(err){
27 console.log(err);
28});
29
30hutch.on('error', function(err) {
31 console.log(err);
32});