Creates a new instance of connection resolver.
(optional) component configuration parameters
(optional) component references
Adds a new connection to component connections
new connection parameters to be added
Configures component by passing configuration parameters.
configuration parameters to be set.
Gets all connections configured in component configuration.
Redirect to Discovery services is not done at this point. If you need fully fleshed connection use resolve method instead.
a list with connection parameters
Registers the given connection in all referenced discovery services. This method can be used for dynamic service discovery.
(optional) transaction id to trace execution through call chain.
a connection to register.
callback function that receives registered connection or error.
Resolves a single component connection. If connections are configured to be retrieved from Discovery service it finds a IDiscovery and resolves the connection there.
(optional) transaction id to trace execution through call chain.
callback function that receives resolved connection or error.
Resolves all component connection. If connections are configured to be retrieved from Discovery service it finds a IDiscovery and resolves the connection there.
(optional) transaction id to trace execution through call chain.
callback function that receives resolved connections or error.
Sets references to dependent components.
references to locate the component dependencies.
Generated using TypeDoc
Helper class to retrieve component connections.
If connections are configured to be retrieved from IDiscovery, it automatically locates IDiscovery in component references and retrieve connections from there using discovery_key parameter.
Configuration parameters
connection:
connections: alternative to connection
References
*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connectionsConnectionParams
IDiscovery
Example
let config = ConfigParams.fromTuples( "connection.host", "10.1.1.100", "connection.port", 8080 ); let connectionResolver = new ConnectionResolver(); connectionResolver.configure(config); connectionResolver.setReferences(references); connectionResolver.resolve("123", (err, connection) => { // Now use connection... });