lib/config/index.js
function createTopology(connectionInfo, logger) {
    let options = connectionInfo;
    if (typeof(connectionInfo) === 'string') {
      let parsed = url.parse(connectionInfo);
      options = {
        server: parsed.hostname,
        port: parsed.port || '5672',
        protocol: parsed.protocol || 'amqp://',
        user: parsed.auth && parsed.auth.indexOf(':') !== -1 ? unescape(parsed.auth.split(':')[0]) : 'guest',
        pass: parsed.auth && parsed.auth.indexOf(':') !== -1 ? unescape(parsed.auth.split(':')[1]) : 'guest',
        vhost: parsed.path && parsed.path.substring(1)
      };
    }
    let connection = Connection(options, logger.withNamespace('connection'));
    let topology = Topology(connection, logger.withNamespace('topology'));
    return topology;
  }
function createTopology(connectionInfo, logger) {
    let options = connectionInfo;
    if (typeof(connectionInfo) === 'string') {
      let parsed = url.parse(connectionInfo);
      options = {
        server: parsed.hostname,
        port: parsed.port || '5672',
        protocol: parsed.protocol || 'amqp://',
        user: parsed.auth && parsed.auth.indexOf(':') !== -1 ? unescape(parsed.auth.split(':')[0]) : 'guest',
        pass: parsed.auth && parsed.auth.indexOf(':') !== -1 ? unescape(parsed.auth.split(':')[1]) : 'guest',
        vhost: parsed.path && parsed.path.substring(1)
      };
    }
    let connection = Connection(options, logger.withNamespace('connection'));
    let topology = Topology(connection, logger.withNamespace('topology'));
    return topology;
  }
function createTopology ( connectionInfo , logger ) { let options = connectionInfo ; if ( typeof ( connectionInfo ) === 'string' ) { let parsed = url . parse ( connectionInfo ) ; options = { server : parsed . hostname , port : parsed . port || '5672' , protocol : parsed . protocol || 'amqp://' , user : parsed . auth && parsed . auth . indexOf ( ':' ) !== - 1 ? unescape ( parsed . auth . split ( ':' ) [ 0 ] ) : 'guest' , pass : parsed . auth && parsed . auth . indexOf ( ':' ) !== - 1 ? unescape ( parsed . auth . split ( ':' ) [ 1 ] ) : 'guest' , vhost : parsed . path && parsed . path . substring ( 1 ) } ; } let connection = Connection ( options , logger . withNamespace ( 'connection' ) ) ; let topology = Topology ( connection , logger . withNamespace ( 'topology' ) ) ; return topology ; }
Create a Topology instance, for use in broker or binder
@public
@param {Object|String} connectionInfo - connection info to be passed to amqplib's connect method (required)
@param {String} connectionInfo.name - connection name (for logging purposes)
@param {String} connectionInfo.server - list of servers to connect to, separated by ','
@param {String} connectionInfo.port - list of ports to connect to, separated by ','. Must have the same number of entries as connectionInfo.server
@param {Number} connectionInfo.heartbeat - heartbeat timer - defaults to 30 seconds
@param {String} connectionInfo.protocol - connection protocol - defaults to amqp:// or amqps://
@param {String} connectionInfo.user - user name - defaults to guest
@param {String} connectionInfo.pass - password - defaults to guest
@param {String} connectionInfo.vhost - vhost to connect to - defaults to '/'
@param {String} connectionInfo.timeout - connection timeout
@param {String} connectionInfo.certPath - certificate file path (for SSL)
@param {String} connectionInfo.keyPath - key file path (for SSL)
@param {String} connectionInfo.caPath - certificate file path(s), separated by ',' (for SSL)
@param {String} connectionInfo.passphrase - certificate passphrase (for SSL)
@param {String} connectionInfo.pfxPath - pfx file path (for SSL)
@param {Object} logger - the logger to use when creating the connection & topology
 /* eslint-disable complexity
Create a Topology instance for use in broker or binder