Vault

@baseline-protocol/messaging

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.‌

Installation

npm install @baseline-protocol/vault(npm package soon to be published)

Building

You can build the package locally with npm run build.‌

Interfaces

IMessagingService
1
connect(): Promise<any>;
2
disconnect(): Promise<void>;
3
getSubscribedSubjects(): string[];
4
isConnected(): boolean;
5
publish(subject: string, payload: any, reply?: string, recipientId?: string, senderId?: string): Promise<void>;
6
request(subject: string, timeout: number, data?: any): Promise<any | void>;
7
subscribe(subject: string, callback?: (msg: any, err?: any) => void, myId?: string): Promise<any>;
8
unsubscribe(subject: string);
9
flush(): Promise<void>;
Copied!

Supported Providers & Protocols

The following messaging providers are available:‌
  • NATS
  • Whisper
Last modified 4mo ago