1 | var AMQPHutch = require('../');
|
2 |
|
3 | var hutch = new AMQPHutch();
|
4 |
|
5 | var 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 |
|
21 | hutch.initialise({
|
22 | connectionString: 'amqp://bad',
|
23 | retryWait: 100
|
24 | });
|
25 |
|
26 | hutch.publish(options, "Example Message!", function(err){
|
27 | console.log(err);
|
28 | });
|
29 |
|
30 | hutch.on('error', function(err) {
|
31 | console.log(err);
|
32 | });
|