Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
event-sourcerer-client
Advanced tools
Event Sourcing client
This client would be in charge of handling publishing of events to the event sourcing service.
The intent is for this client to be an abstraction over whatever protocol/transport/service we decide to use for event publishing and consumption.
const Jackrabbit = require('jackrabbit');
const EventSourcerer = require('@pager/event-sourcerer-client');
const Client = EventSourcerer.Client;
const SingleKeyRabbitTransport = EventSourcerer.transports.SingleKeyRabbit;
const rabbit = Jackrabbit('amqp://localhost')
const transport = new SingleKeyRabbit(rabbit, { exchangeName: 'pager' })
const client = new Client(transport)
const stream = 'chats'
const streamId = '123456'
const eventType = 'created'
const data = { 'name': 'my chat' }
client.publish(stream, streamId, eventType, data)
Client(transport)
transport
- an instance of an object with a publish function that implements actual publishing of messages.publish(stream, streamId, eventType, data)
stream
- Name identifying the type of the stream, the stream is the category name to which we publish messages, analog to a model/entity name.streamId
- Identifier for a particular instance of the streameventType
- Name of the event.data
- An object with fields and values for the eventThis transport can be used to publish messages to a RabbitMQ instance, under a single key by stream. The key being events.{stream}.created
.
SingleKeyRabbitTransport(rabbitConnection, options)
rabbit
- Configured connection to rabbit, as the one returned by @pager/jackrabbit
or a compatible one.options
- settings:
exchangeName
- name of the RabbitMQ exchange. Required.exchangeType
- Type of exchange. Optional. Possible values: topic
, default
. Defaults to topic
This transport can be used to publish messages to a RabbitMQ instance, where every event is published to it's own key. The key being {stream}.{eventType}
.
MultiKeyRabbitTransport(rabbitConnection, options)
rabbit
- Configured connection to rabbit, as the one returned by @pager/jackrabbit
or a compatible one.options
- settings:
exchangeName
- name of the RabbitMQ exchange. Required.exchangeType
- Type of exchange. Optional. Possible values: topic
, default
. Defaults to topic
This transport can be used to publish messages to a RabbitMQ instance, under a single key by stream. The key being events.{stream}.created
.
SingleKeyRabbitTransport(rabbitConnection, options)
rabbit
- Configured connection to rabbit, as the one returned by @pager/jackrabbit
or a compatible one.FAQs
event-sourcerer client
We found that event-sourcerer-client 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.