@golemio/core
v4.0.0
Published
Golemio Core Module
Downloads
12,058
Readme
This module is intended for use with Golemio services.
Prerequisites
- node.js (https://nodejs.org)
- RabbitMQ (https://www.rabbitmq.com/)
- Postgres (https://www.postgresql.org/)
- Redis (https://redis.io/)
- TypeScript (https://www.typescriptlang.org/)
- Golemio Schema Definitions
Installation
Install all prerequisites
Install all dependencies using command:
npm installfrom the application's root directory.
Compilation of typescript code
To compile typescript code into js one-time
npm run buildor run this, to watch all changes
npm run build-watchfrom the application's root directory.
Usage
In your project's package.json set dependency to @golemio/core
npm install --save @golemio/coreThen 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-watchAt the @golemio/pid root directory:
npx link /path/to/golemio/modules/core
npm run build-watchAt the @golemio/integration-engine root directory:
npx link /path/to/golemio/modules/core
npx link /path/to/golemio/modules/pid
npm run dev-startNow you can change code and immediately see the results.
Tests
To run all test defined in /test directory simply run this command:
npm run testfrom 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 [email protected]
