Baseline core messaging package.
NATS is currently the default point-to-point messaging provider and the recommended way for organizations to exchange secure protocol messages. NATS was chosen due to its high-performance capabilities, community/enterprise footprint, interoperability with other systems and protocols (i.e. Kafka and MQTT) and its decentralized architecture.
npm install @baseline-protocol/messaging(npm package soon to be published)
You can build the package locally with
npm run build.
publish(subject: string, payload: any, reply?: string, recipientId?: string, senderId?: string): Promise<void>;
request(subject: string, timeout: number, data?: any): Promise<any | void>;
subscribe(subject: string, callback?: (msg: any, err?: any) => void, myId?: string): Promise<any>;
The following messaging providers are available: