moleculerjs/moleculer - v0.14.8
MoleculerGithub Sponsoring is available for Moleculer :tada:
We have been approved in Github Sponsors program, so you can sponsor the Moleculer project via Github Sponsors.
If you have taxing problem with Patreon, change to Github Sponsors.
New Validator configuration
The validator has the same module configuration in broker options like other modules. It means you can configure the validation constructor options via broker options (moleculer.config.js).
Default usage:
//moleculer.config.js
module.exports = {
nodeID: "node-100",
validator: true // Using the default Fastest Validator
}
Using built-in validator name:
//moleculer.config.js
module.exports = {
nodeID: "node-100",
validator: "FastestValidator" // Using the Fastest Validator
}
Example with options:
//moleculer.config.js
module.exports = {
nodeID: "node-100",
validator: {
type: "FastestValidator",
options: {
useNewCustomCheckerFunction: true,
defaults: { /*...*/ },
messages: { /*...*/ },
aliases: { /*...*/ }
}
}
}
Example with custom validator
//moleculer.config.js
const BaseValidator = require("moleculer").Validators.Base;
class MyValidator extends BaseValidator {}
module.exports = {
nodeID: "node-100",
validator: new MyValidator()
}
New metrics
Added the following new metrics:
moleculer.event.received.active: Number of active event executions.moleculer.event.received.error.total: Number of event execution errors.moleculer.event.received.time: Execution time of events in milliseconds.os.memory.total: OS used memory size.
Other changes
support using
moleculer.config.jswithexport default.remove some lodash methods.
upgrade to the latest
tsd.new
dependencyIntervalbroker option. Using as default value forbroker.waitForServices#761fix Datadog traceID, spanID generation logic to work with latest
dd-trace.add error stack trace to
EventLegacytrace exporter.fix INFO key issue in Redis Discoverer after Redis server restarting.