jerni a framework to build data-driven products from the ground up
Type: | JourneyConfig |
Namespace: | jerni |
Extends: | Object |
Description: | Describe a journey configuration |
Properties
writeTo:
string
events queue server address
Examples
"http://localhost:6181"
"http://192.168.1.117:9000"
"http://jerni.dev/project/1001472"
Examples
MongoDbStore
from package: @jerni/store-mongo
onError:
(Error, CommittedEvent) => Promise<SkipSymbol|void>
this callback is triggered on every uncaught exception thrown in projection stage. To ignore an error, you need to explicitly return jerni/skip symbol
Examples
file: log-error-sentry.js
const journey = createJourney({writeTo: 'http://some-server.com',stores: [/* ... */],async onError(err, event) {if (SENTRY_DSN) {Sentry.withScope((scope) => {scope.setLevel('fatal');scope.setFingerprint(['{{ default }}', 'journey']);scope.setExtra('offendingEvent', event);if (err.name === 'JerniStoreMongoWriteError') {scope.setExtra('mongo_code', err.code);scope.setExtra('mongo_op', JSON.stringify(err.op));scope.setExtra('model', err.model);}Sentry.captureException(err);});await Sentry.flush(5000);}}});
file: skip-error.js
const journey = createJourney({writeTo: 'http://some-server.com',stores: [/* ... */],async onError(err, event) {// we don't need to handle error for this event because …if (event.type === "SOME_EVENT") {return require('jerni/skip');}}});