File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * amqp 参数配置
3
+ * @see https://github.com/dial-once/node-bunnymq
4
+ */
5
+
6
+ module . exports = {
7
+ host : 'amqp://localhost' , // connect url
8
+ prefetch : 5 , // number of fetched messages at once on the channel
9
+ requeue : true , // requeue put back message into the broker if consumer crashes/trigger exception
10
+ timeout : 1000 , // time between two reconnect (ms)
11
+ rpcTimeout : 1000 // default timeout for RPC calls. If set to '0' there will be none.
12
+ }
Original file line number Diff line number Diff line change 1
1
/**
2
2
* 消息队列,简单实现了消息订阅、发布和RPC调用
3
+ * @see https://github.com/dial-once/node-bunnymq
3
4
* 也可参考 https://github.com/tjmehta/amqplib-rpc 实现方式
4
5
*/
5
6
6
7
var bunnymq = require ( 'bunnymq' )
7
-
8
- var config = {
9
- host : 'amqp://localhost' , // connect url
10
- prefetch : 5 , // number of fetched messages at once on the channel
11
- requeue : true , // requeue put back message into the broker if consumer crashes/trigger exception
12
- timeout : 1000 , // time between two reconnect (ms)
13
- rpcTimeout : 1000 // default timeout for RPC calls. If set to '0' there will be none.
14
- }
8
+ var config = require ( '../../config/rabbitmq' )
15
9
16
10
var conn = bunnymq ( config )
17
11
var producer = conn . producer
You can’t perform that action at this time.
0 commit comments