• Blazing fast

    High performance microservices framework. Check our benchmark results!

  • Extensible

    All built-in modules (caching, serializer, transporter) are pluggable. You can use your custom solutions.

  • Open source

    Moleculer is 100% open source and free of charge. All source code is available under the MIT License on GitHub.

  • Fault tolerance

    Moleculer is a fault tolerance framework. It has built-in load balancer & circuit breaker.

const { ServiceBroker } = require("moleculer");
// Create broker
let broker = new ServiceBroker({ logger: console });
// Create a service
broker.createService({
name: "math",
actions: {
// You can call it as broker.call("math.add")
add(ctx) {
return Number(ctx.params.a) + Number(ctx.params.b);
}
}
});
// Start broker
broker.start();
// Call actions of service
broker.call("math.add", { a: 5, b: 3 })
.then(res => console.log("5 + 3 =", res));