The performance counters.
The dependency resolver.
The GRPC endpoint that exposes this service.
The logger.
Closes component and frees used resources.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Configures component by passing configuration parameters.
configuration parameters to be set.
Adds instrumentation to log calls and measure call time. It returns a CounterTiming object that is used to end the time measurement.
(optional) transaction id to trace execution through call chain.
a method name.
CounterTiming object to end the time measurement.
Adds instrumentation to error handling.
(optional) transaction id to trace execution through call chain.
a method name.
an occured error
(optional) an execution result
(optional) an execution callback
Checks if the component is opened.
true if the component has been opened and false otherwise.
Opens the component.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Registers all service routes in HTTP endpoint.
This method is called by the service and must be overriden in child classes.
Registers a commandable method in this objects GRPC server (service) by the given name.,
the GRPC method name.
the schema to use for parameter validation.
the action to perform at the given route.
Registers a middleware for methods in GRPC endpoint.
an action function that is called when middleware is invoked.
Registers a method in GRPC service.
a method name
a validation schema to validate received parameters.
an action function that is called when operation is invoked.
Sets references to dependent components.
references to locate the component dependencies.
Unsets (clears) previously set references to dependent components.
Generated using TypeDoc
Abstract service that receives remove calls via GRPC protocol.
Configuration parameters
References
*:logger:*:*:1.0
(optional) ILogger components to pass log messages*:counters:*:*:1.0
(optional) ICounters components to pass collected measurements*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connection*:endpoint:grpc:*:1.0
(optional) GrpcEndpoint referenceGrpcClient
Example
class MyGrpcService extends GrpcService { private _controller: IMyController; ... public constructor() { base('... path to proto ...', '.. service name ...'); this._dependencyResolver.put( "controller", new Descriptor("mygroup","controller","*","*","1.0") ); } public setReferences(references: IReferences): void { base.setReferences(references); this._controller = this._dependencyResolver.getRequired<IMyController>("controller"); } public register(): void { registerMethod("get_mydata", null, (call, callback) => { let correlationId = call.request.correlationId; let id = call.request.id; this._controller.getMyData(correlationId, id, callback); }); ... } } let service = new MyGrpcService(); service.configure(ConfigParams.fromTuples( "connection.protocol", "http", "connection.host", "localhost", "connection.port", 8080 )); service.setReferences(References.fromTuples( new Descriptor("mygroup","controller","default","default","1.0"), controller )); service.open("123", (err) => { console.log("The GRPC service is running on port 8080"); });