Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
@epsor/consumer-wrapper
Advanced tools
@epsor/consumer-wrapper
It wrap the consumer connection to kafka, redis connexion, mongodb connexion to help you to develop new consumer faster.
@epsor/consumer-wrapper
assumes that a few environment variables are set:
EVENT_TOPIC
- The event topic to consumeMONGODB_URL
- The mongoDB server urlREDIS_URL
- The redis server urlKAFKA_HOST
- The kafka server info IP:PORTKAFKA_GROUP_ID
- The kafka group idThis package comes with AbstractHandler
which is supposed to be extanded by your consumers handler.
Here an example of a handler:
import { MongoDuplicateEntryError } from '@epsor/mongodb-wrapper';
class UserCreateHandler extends AbstractHandler {
/** @inheritdoc */
static get handlerName() {
return 'UserCreate';
}
/** @inheritdoc */
static get allowedTypes() {
return ['user.created'];
}
/** @inheritdoc */
static async handle({ mongo }, userCreatedDto) {
const users = await mongo.collection('users');
try {
await users.insertOne(userCreatedDto.fields);
} catch (err) {
if (err instanceof MongoDuplicateEntryError) {
// An error occurred
}
}
}
}
import { Consumer } from '@epsor/consumer-wrapper';
/** @type {AbstractHandler[]} */
import handlers from './handlers';
(async () => {
const consumer = new Consumer('b2c', handlers);
await consumer.initDependencies();
await consumer.createCollections('users');
await consumer.run();
})();
This package contains an express api endpoint to check pod's health.
npm start
to start the server.http://localhost:{HEALTHCHECK_PORT}/.well-known/express/server-health
. Default port is 8000
please look at the README.md of epsor-v2 to get the list of supported ports for every consumers.
FAQs
Event consumer
The npm package @epsor/consumer-wrapper receives a total of 0 weekly downloads. As such, @epsor/consumer-wrapper popularity was classified as not popular.
We found that @epsor/consumer-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 26 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.