
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Maestrojs is a library for service orchestration relying on Redis for service discovery
Maestro.js is a library that helps dynamically orchestrate different services using Redis. Services do not need to know any information about the service they depend on (only the name), this library will be responsible to resolve the options necessary to connect to all services and keep the service updated with the latest options.
Maestro.js goal is to be very simple to set up
Use case: You have 5 services using a cluster of redis machines for caching. You add a new redis and insert it into redis. Now all your services using that cache cluster will seamlessly update to use this new cache.
var redis = require('redis');
var Maestro = require("maestrojs");
/**
* Initialize Maestro with Redis endpoint
*/
var maestro = new Maestro("127.0.0.1", 6379); //default values
/**
* Wait for Redis information and connect to it
* (If another redis registers, then Maestro will automatically
* update your application to use it)
*/
maestro.use('services.redis', function(entries) {
var redis = redis.createClient(entries[0].endpoint);
app.use('redis', redis);
})
/**
* Register the interface for this service
*/
maestro.register("services.api", {
endpoint: "198.176.45.68",
version: 2.1,
something: true
});
/**
* Start the service
* (it will only be executed after all dependencies are resolved)
*/
maestro.start(function() {
// Start listening for requests
});
npm install maestrojs
Declare a dependency and a callback for setting up this dependency. The callback is called everytime that service is updated. (in the case of a cache cluster, if a new cache node registers, the setup callback will be run again)
maestro.use('services.queue', function(entries) {
var queues = [], sqs;
for (var i = 0; i < entries.length; i++) {
sqs = new Sqs(entries[i].endpoint);
queues.push(sqs);
}
app.use("queues", queues);
})
Declare a service's interface. It will automatically append the service to the list as soon as it is available. It is important that your service does not replace a service under the same name. This way you may have several nodes serving the same service. Options_ is an object containing as many attributes as desired. _(_id is a reserved attribute).
maestro.register("services.mailer", {
endpoint: "198.167.14.1",
supportHtml: true,
version: 3
});
The service will be registered after the start function runs.
Callback function called as soon as as all dependencies are resolved. Make sure to have all the dependencies declared before calling this function.
maestro.start(function() {
var server = app.listen(3000);
})
You may register your service within the start callback:
maestro.start(function() {
var server = app.listen(3000, function () {
var host = server.address().address
var port = server.address().port
maestro.register("services.mailer", {
host: host,
port: port
});
})
})
Quitting allows you to automatically unregister your service and updating all services dependent on yours. Quitting will also close all connections to redis, so it won't receive more updates from other services, therefore use it only when you intend to close your service.
maestro.quit(function() {
console.log("Service unregistered and connections closed")
});
If you want to unregister your service but not stop listening to updates from other services. You may use Maestro.unregister, which will unregister your service and update all services dependent on it.
maestro.unregister(function() {
console.log("Service unregistered")
});
It is important to notice that we require Redis to be configured to notify Maestro in case of key changes. You may set notify-keyspace-events "AKE" in redis.conf or start redis as ./redis-server --notify-keyspace-events AKE
FAQs
Maestrojs is a library for service orchestration relying on Redis for service discovery
We found that maestrojs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.