1.0.2 • Published 6 years ago

rabbitmq-retry v1.0.2

Weekly downloads
3
License
ISC
Repository
-
Last release
6 years ago

rabbitmq-retry

支持rabbitmq重连

本地测试
// 修改test目录下的 consumer 和 producer 中的mq地址

// 启动消费者
DEBUG=rabbit node test/consumer.js

// 启动 producer
node test/producer.js
在命令行中输入任意字符, 消费者控制台会打印出相同字符
使用方式
// dir为消费者目录
// path 自定义要加载的消费者,比如 '-foo,bar',不加载foo,只加载bar,方便调试
// 默认重连时间为3s
new Rabbit({
  url: 'amqp://xuezj:xuezj@localhost:5672/%2ftest?heartbeat=10',
  dir: path.resolve(__dirname, './consumers'),
  path: 'foo'
})

// 默认开启优雅关闭
接受到SIGINT信号后,先停止接收消息,然后关闭连接,最后停止进程
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

9 years ago