Moleculer v0.14.8 Release Notes

Release Date: 2020-06-27 // almost 4 years ago
  • Github Sponsoring is available for Moleculer :tada:

    We have been approved in the 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 as other modules. It means you can configure the validation constructor options via broker options (moleculer.config.js).

    0๏ธโƒฃ 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.js with export default.
    • โœ‚ remove some lodash methods.
    • โฌ†๏ธ upgrade to the latest tsd.
    • ๐Ÿ†• new dependencyInterval broker option. Using as default value for broker.waitForServices #761
    • ๐Ÿ›  fix Datadog traceID, spanID generation logic to work with latest dd-trace.
    • โž• add error stack trace to EventLegacy trace exporter.
    • ๐Ÿ›  fix INFO key issue in Redis Discoverer after Redis server restarting.