Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

moleculer

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moleculer - npm Package Versions

1
12

0.14.6

Diff

Changelog

Source

0.14.6 (2020-04-11)

New NewRelic zipkin tracing exporter

Thanks for @jalerg, there is a NewRelic tracing exporter. PR #713

// moleculer.config.js
{
    tracing: {
        enabled: true,
        events: true,
        exporter: [
            {
                type: 'NewRelic',
                options: {
                    // NewRelic Insert Key
                    insertKey: process.env.NEW_RELIC_INSERT_KEY,
                    // Sending time interval in seconds.
                    interval: 5,
                    // Additional payload options.
                    payloadOptions: {
                        // Set `debug` property in payload.
                        debug: false,
                        // Set `shared` property in payload.
                        shared: false,
                    },
                    // Default tags. They will be added to all span tags.
                    defaultTags: null,
                },
            },
        ],
    },    
}

Other changes

  • fix stream chunking issue. PR #712
  • fix INFO packet sending issue after reconnecting
  • safely handling disconnected state for transporters (heartbeat queuing issue). PR #715
  • fix orhpan response issue in case of streaming with disabled balancer. #709
  • update dependencies, audit fix

<a name="0.14.5"></a>

icebob
published 0.14.5 •

Changelog

Source

0.14.5 (2020-03-25)

Wrapping service methods with middlewares

New localMethod hook in middlewares which wraps the service methods.

Example

// my.middleware.js
module.exports = {
    name: "MyMiddleware",

    localMethod(next, method) {
        return (...args) => {
            console.log(`The '${method.name}' method is called in '${method.service.fullName}' service.`, args);
            return handler(...args);
        }
    }
}

Schema for service methods

Similar to action schema, you can define service methods with schema. It can be useful when middleware wraps service methods.

Example for new method schema

// posts.service.js
module.exports = {
    name: "posts",

    methods: {
        list: {
            async handler(count) {
                // Do something
                return posts;
            }
        }
    }
};

Changes

  • add chunk limit for streams in message transporting. #683
  • add baseUrl option to Datadog metric reporter. #694
  • fix open handles in unit tests. #695
  • update d.ts #699 #700 #703

<a name="0.14.4"></a>

icebob
published 0.14.4 •

Changelog

Source

0.14.4 (2020-03-08)

Changes

  • add maxSafeObjectSize to service broker options. Fixes #697
  • add stop method to tracing exporters. Fixes #689
  • fix EventLegacy tracing exporter. Fixes #676
  • the defaultTags property in tracer options can be a Function, as well.

<a name="0.14.3"></a>

icebob
published 0.14.3 •

Changelog

Source

0.14.3 (2020-02-24)

Changes

  • fix issue in AMQP 1.0 transporter

<a name="0.14.2"></a>

icebob
published 0.14.2 •

Changelog

Source

0.14.2 (2020-02-14)

Support custom loggers

If you have your custom logger you should wrap it into a Logger class and implement the getLogHandler method.

Using a custom logger

// moleculer.config.js
 const BaseLogger = require("moleculer").Loggers.Base;

class MyLogger extends BaseLogger {
    getLogHandler(bindings) {
        return (type, args) => console[type](`[MYLOG-${bindings.mod}]`, ...args);
    }
}

module.exports = {
    logger: new MyLogger()
};

<a name="0.14.1"></a>

icebob
published 0.14.1 •

Changelog

Source

0.14.1 (2020-02-12)

Changes

  • fix bluebird import issue #674

<a name="0.14.0"></a>

icebob
published 0.14.0 •

Changelog

Source

0.14.0 (2020-02-12)

Migration guide from 0.13 to 0.14

Breaking changes

Minimum Node version is 10

The Node version 8 LTS lifecycle has been ended on December 31, 2019, so the minimum required Node version is 10.

Bluebird dropped

The Bluebird Promise library has been dropped from the project because as of Node 10 the native Promise implementation is faster (2x) than Bluebird.

Nonetheless, you can use your desired Promise library, just set the Promise broker options.

Using Bluebird

const BluebirdPromise = require("bluebird");

// moleculer.config.js
module.exports = {
    Promise: BluebirdPromise
};

Please note, the given Promise library will be polyfilled with delay, method, timeout and mapSeries methods (which are used inside Moleculer core modules).

Communication protocol has been changed

The Moleculer communication protocol has been changed. The new protocol version is 4. It means the new Moleculer 0.14 nodes can't communicate with old <= 0.13 nodes.

icebob
published 0.13.13 •

Changelog

Source

0.13.13 (2020-02-11)

AMQP 1.0 transporter

Thanks for @vladir95, AMQP 1.0 transporter is available.

Please note, it is an experimental transporter. Do not use it in production yet!

// moleculer.config.js
module.exports = {
    transporter: "amqp10://activemq-server:5672"
};

To use this transporter install the rhea-promise module with npm install rhea-promise --save command.

Transporter options

Options can be passed to rhea.connection.open() method, the topics, the queues, and the messages themselves.

Connect to 'amqp10://guest:guest@localhost:5672'

// moleculer.config.js
module.exports = {
    transporter: "AMQP10"
};

Connect to a remote server

// moleculer.config.js
module.exports = {
    transporter: "amqp10://activemq-server:5672"
};

Connect to a remote server with options & credentials

// moleculer.config.js
module.exports = {
    transporter: {
        url: "amqp10://user:pass@activemq-server:5672",
        eventTimeToLive: 5000,
        heartbeatTimeToLive: 5000,
        connectionOptions: { // rhea connection options https://github.com/amqp/rhea#connectoptions, example:
            ca: "", // (if using tls)
            servername: "", // (if using tls)
            key: "", // (if using tls with client auth)
            cert: "" // (if using tls with client auth)
        },
        queueOptions: {}, // rhea queue options https://github.com/amqp/rhea#open_receiveraddressoptions
        topicOptions: {}, // rhea queue options https://github.com/amqp/rhea#open_receiveraddressoptions
        messageOptions: {}, // rhea message specific options https://github.com/amqp/rhea#message
        topicPrefix: "topic://", // RabbitMq uses '/topic/' instead, 'topic://' is more common
        prefetch: 1
    }
};

Redis Cluster feature in Redis transporter

Thanks for AAfraitane, use can connect to a Redis Cluster with the Redis transporter.

Connect to Redis cluster

// moleculer.config.js
module.exports = {
    transporter: {
        type: "Redis",
        options: {
            cluster: {
                nodes: [
                    { host: "localhost", port: 6379 },
                    { host: "localhost", port: 6378 }
                ]
            }
        }
    }
};

<a name="0.13.12"></a>

icebob
published 0.14.0-rc2 •

icebob
published 0.14.0-rc1 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc