-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor rabbit-config to a separate library
- Loading branch information
Showing
5 changed files
with
166 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
const AmqpStats = require('amqp-stats') | ||
const jackrabbit = require('jackrabbit') | ||
const RabbitConfig = require('./rabbit-config') | ||
|
||
module.exports = function rabbitFn(settings) { | ||
|
||
// Build up config object | ||
const config = RabbitConfig(settings) | ||
|
||
// Initialize libraries | ||
const rabbit = jackrabbit(config.jackrabbitConnection, config.jackrabbitSsl) | ||
const exchange = rabbit.default() | ||
const stats = new AmqpStats(config.amqpStats) | ||
|
||
return { | ||
rabbit, | ||
exchange, | ||
stats, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters