
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.
node-red-syslog
Advanced tools
Redis stream consumer with conditional acknowledgments and resource management
A reusable library for consuming Redis streams reliably using consumer groups, with back‑pressure, retry, and dynamic concurrency control based on system load. Can be used as a standalone library or as a Node-RED node.
Add the package to your project:
npm install redis-syslog-consumer
If using Node-RED, restart your Node-RED instance to load the new nodes.
const { StreamProcessor, GlobalResource } = require("redis-syslog-consumer");
// Create a map to store processor instances
const processors = new Map();
// Create a resource manager
const resourceManager = new GlobalResource(processors, {
maxConcurrency: 10,
minConcurrency: 1,
});
// Start the resource manager
resourceManager.start();
// Message handler function
const handleMessage = (message) => {
console.log("Received message:", message.payload);
console.log("Redis ID:", message._redisId);
// Process the message...
// After processing, acknowledge the message
streamProcessor.acknowledgeAndDelete(message._redisId);
};
// Create a stream processor
const streamProcessor = new StreamProcessor(
"redis://localhost:6379",
"syslog",
resourceManager.concurrency,
handleMessage
);
// Register with resource manager
processors.set("syslog", streamProcessor);
// Initialize the stream processor
streamProcessor.initialize();
// Cleanup on shutdown
process.on("SIGINT", () => {
processors.delete("syslog");
resourceManager.stop();
process.exit(0);
});
Once installed, you'll have two new nodes in the palette under Syslog and config:
redis-syslog-consumer)redis-syslog-resource-manager)| Property | Type | Description |
|---|---|---|
| Name | String | Optional label |
| Redis URL | String | Connection URI (redis://host:port) |
| Stream Key | String | Redis stream name (e.g. syslog) |
| Resource Manager | Config | Select your redis-syslog-resource-manager node |
StreamProcessor with:
grp:<stream>name:<id>0)msg.payload) with metadata (msg._redisId).{ _redisId, _redisAck: true } into the node to ACK/DEL from the stream.Global config node that monitors CPU and RAM and adjusts all active Redis Syslog Consumer nodes' concurrency based on hysteresis thresholds.
| Property | Default | Description |
|---|---|---|
| Max Concurrency | 10 | Upper bound for message‐parallelism |
| Min Concurrency | 1 | Lower bound for parallelism |
| Sampling Size | 10 | Number of samples in sliding window |
| Sampling Interval (ms) | 5000 | Time between CPU/RAM checks |
| Upper CPU Threshold (%) | 80 | CPU% above which concurrency is halved |
| Lower CPU Threshold (%) | 30 | CPU% below which concurrency is doubled |
| Upper RAM Threshold (%) | 80 | RAM% above which concurrency is halved |
| Lower RAM Threshold (%) | 30 | RAM% below which concurrency is doubled |
pidusage to sample process CPU and memory.StreamProcessorconst { StreamProcessor } = require("redis-syslog-consumer");
new StreamProcessor(
url: string,
stream: string,
concurrency: number,
onMessageCallback: (msg: { payload: string; _redisId: string }) => void,
options?: {
logger?: (message: string, context?: string) => void,
status?: (fill: string, shape: string, text: string) => void,
consumerName?: string,
consumerGroupPrefix?: string
}
)
url: Redis connection URIstream: Redis stream keyconcurrency: max parallel messagesonMessageCallback: invoked with each parsed messageoptions: Optional configurationinitialize(): Promise<void> – start consuming (create group, drain backlog, poll).acknowledgeAndDelete(messageId: string): Promise<void> – XACK + XDEL for a given message.setConcurrency(newConcurrency: number) – dynamically adjust concurrency.GlobalResourceconst { GlobalResource } = require("redis-syslog-consumer");
new GlobalResource(
processors: Map<string, { setConcurrency: (number) => void }>,
config?: {
maxConcurrency?: number,
minConcurrency?: number,
samplingCount?: number,
samplingIntervalMs?: number,
upperCpuThresholdPercent?: number,
lowerCpuThresholdPercent?: number,
upperMemThresholdPercent?: number,
lowerMemThresholdPercent?: number
},
logger?: (message: string, context?: string) => void
)
start() - Start monitoring CPU and RAM usagestop() - Stop monitoringregisterProcessor(streamKey: string, processor: object) - Add a processorunregisterProcessor(streamKey: string) - Remove a processorget concurrency() - Get current concurrency value[
{
"id": "1",
"type": "redis-syslog-resource-manager",
"name": "ResourceManager",
"concurrencyMax": 20,
"concurrencyMin": 1,
"samplingCount": 15,
"samplingInterval": 3000,
"thresholdUpper": 75,
"thresholdLower": 25,
"thresholdUpperMem": 75,
"thresholdLowerMem": 25
},
{
"id": "2",
"type": "redis-syslog-consumer",
"stream": "syslog",
"url": "redis://127.0.0.1:6379",
"resource": "1",
"wires": [["3"], ["4"]]
}
]
Inject back to acknowledge:
{ "payload": { "redis": { "id": "1680000000000-0", "ack": true } } }
Contributions are welcome! Please fork the repository, create a feature branch, and submit a pull request with a detailed explanation of changes.
We use SemVer for versioning. For the versions available, see the tags on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
Redis stream consumer with conditional acknowledgments and resource management
The npm package node-red-syslog receives a total of 13 weekly downloads. As such, node-red-syslog popularity was classified as not popular.
We found that node-red-syslog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.