This module is intended for use with Golemio services.
Prerequisites
Installation
Install all prerequisites
Install all dependencies using command:
npm install
from the application's root directory.
Compilation of typescript code
To compile typescript code into js one-time
npm run build
or run this, to watch all changes
npm run build-watch
from the application's root directory.
Usage
In your project's package.json
set dependency to @golemio/core
npm install --save @golemio/core
Then import module, e.g.
import * as core from "@golemio/core";
Local development
For the local development use the npx link to link the @golemio/core with other service e.g. @golemio/integration-engine
or module e.g. @golemio/pid
.
At the @golemio/core root directory:
npm run build-watch
At the @golemio/pid root directory:
npx link /path/to/golemio/modules/core
npm run build-watch
At the @golemio/integration-engine root directory:
npx link /path/to/golemio/modules/core
npx link /path/to/golemio/modules/pid
npm run dev-start
Now you can change code and immediately see the results.
Tests
To run all test defined in /test directory simply run this command:
npm run test
from the application's root directory. All tests should pass.
Rabbit MQ
Core module defines main exchange in rabbit mq and its name is dependent on .env setting. Also it contains definition of queue for dead messages. All other queues are defined in separate modules and loaded dynamically by QueueProcessor.ts
.
Core module also defines alternate exchange for messages that are unroutable. Name of the exchage is created from name of the main one with suffix -alt
and it contains 1 queue named alt-routes
.
Contribution guidelines
Please read CONTRIBUTING.md
.
Troubleshooting
Contact vyvoj@operatorict.cz