Microservices
Using a dedicated @marblejs/messaging module, Marble.js offers a robust and unified architecture for building event-based microservices.
Installation
$ yarn add @marblejs/messaging @marblejs/core rxjs fp-tsOverview
Consumer
import { createMicroservice, messagingListener, Transport } from '@marblejs/messaging';
import { IO } from 'fp-ts/lib/IO';
import { hello$ } from './consumer.effect';
const listener = messagingListener({
middlewares: [ ... ],
effects: [ hello$ ],
});
const microservice = createMicroservice({
transport: Transport.AMQP
options: {
host: 'amqp://localhost:5672',
queue: 'hello_queue',
},
listener,
dependencies: [ ... ],
});
const main: IO<void> = async () =>
await (await microservice)();
main();Attribute
Description
Publisher
Method
Description
Last updated