
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
light-esb-node
Advanced tools
Because complex processing logic including call to third party systems in Node SHOULD be easy
npm install light-esb-node
To use, simply create components, wire them up and start sending messages to be processed.
var ESB = require('light-esb-node');
// this will be invoked either when there is an error during component processing or when the ResultComponent is reached
function esbCallback(error,message){
if(error){
console.log("ERROR received:", error, message);
}else{
console.log("RESULT received:", message);
}
}
var component = ESB.createLoggerComponent(esbCallback);
var component = ESB.createLoggerComponent(esbCallback);
var receiver1 = ESB.createLoggerComponent(esbCallback);
var receiver2 = ESB.createLoggerComponent(esbCallback);
// when component finishes processing the message the result will be passed by to the receiver1 component and receiver2 component for further processing
component.connect(receiver1);
component.connect(receiver2);
/**
* Represents a ESB Message being processed by components.
*
* @param {object} payload - The payload of the message
* @param {string} callerUser - the entity that originated the message
* @param {string} callerSystem - the system that originated the message
* @param {string} callerCorrelationId - the correlationId in case that this message is a result of some other message processing (correlation chain)
* @type {function}
*/
var ESBMessage = function(payload, callerUser, callerSystem, callerCorrelationId){
this.payload = payload;
this.context = {
createdTimestamp: Date.now(),
correlationId: uuidGenerator.v4(),
caller: {
user: callerUser,
system: callerSystem,
correlationId: callerCorrelationId
}
};
this.originalPayload = clone(payload);
this.vars = {};
}
var component = ESB.createLoggerComponent(esbCallback);
// prepare input message and start processing
var ESBMessage = ESB.createMessage({hello: "world"},"john@doe.com","CRM","x92938XA");
component.send(ESBMessage);
// the message object from now on will be enhanced with the new entry in the vars section (vars.customerData) of the ESBMessage
var component = ESB.createVarComponent("customerData",'SET');
// from now on, the payload of the ESBMessage that will be processed by next component in the flow will be replaced with contents of the vars.customerData object
var component = ESB.createVarComponent("customerData",'GET');
// message payload will be replaced with the provided object, one may use reference to the original message fields using '$' notion
var c21 = ESB.createPayloadComponent(esbCallback, {
"f1":"f1val",
"f2obj": {
"f3":"$message.context.correlationId",
"f4":"f4val"
}
});
// now some merging of messages, contents of vars.customerInfo will be merged into processed message payload
var component = ESB.createCombineComponent("customerInfo");
// the message that reaches this component will be altered by mapping provided - see object-mapper npm module documentation for details how to build maps
var component = ESB.createMapperComponent({"hello":["XYZ.hello","ZZZ.hello"]});
// now it is time for some third party calls, call external REST service
var component1 = ESB.createCallComponent(esbCallback, "https://jsonplaceholder.typicode.com/users", "get");
var component2 = ESB.createCallComponent(esbCallback, "https://jsonplaceholder.typicode.com/posts", "post");
// DELETE call example
var c22 = ESB.createCallComponent(esbCallback, "https://jsonplaceholder.typicode.com/post/${postId}", "delete", {"postId":120});
// full call using path parameter (${postId}), dynamic query params (?param1=) - using '$' reference to message contents and basic auth
var c20 = ESB.createCallComponent(esbCallback, "https://jsonplaceholder.typicode.com/post/${postId}", "post",{"postId":120},{"param1":"$message.context.correlationId"},"username","pass");
// route component - based on ESBMessage.context field values the message will be routed to the appropriate named channel
var c17 = ESB.createRouteComponent(esbCallback, {
routeItems: [
{
routeFunction: function(esbMessage){
if(esbMessage.context.caller.user=="john@doe.com")
return true;
return false;
},
channel: "john"
},
{
routeFunction: function(esbMessage){
if(esbMessage.context.caller.user=="marry@doe.com")
return true;
return false;
},
channel: "marry"
}
]
});
// for router component connected components MUST be connected using channel names
c17.connect("john",c19);
c17.connect("marry",c18);
// script component with custom processing function
var c19 = ESB.createScriptComponent(esbCallback, function(esbMessage, callback){
if(esbMessage.context.caller.user=="john@doe.com"){
esbMessage.payload[0].additionalField = true;
esbMessage.context.caller.user = "johnthegreat@doe.com"
}
});
// at the end of the flow return resulting message - esbCallback function will receive the resulting message object
var component = ESB.createResultComponent(esbCallback);
For a sample flow check samples folder.
// Set the DEBUG environment variable to enable debug output of Light-Esb-Node
// show components initialization
//process.env.DEBUG = 'esb:core, esb:component';
// show components processing messages
//process.env.DEBUG = 'esb:messages';
// show details of remote calls of components
//process.env.DEBUG = 'esb:calls';
// show all
process.env.DEBUG = 'esb:*';
FAQs
Lightweight message processing and orchestration module for Node
We found that light-esb-node 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
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.