Solace JavaScript API and Solace Node.js API Developer Guide

The Solace Messaging API for JavaScript and Solace Messaging API for Node.js are designed to enable JavaScript and Node.js applications to interact seamlessly with the Solace event broker. These APIs provide comprehensive support for message exchange patterns such as point-to-point and publish-subscribe, offering advanced messaging features for web browsers and server-side JavaScript applications.

To get you started, here is a brief overview of some of the key messaging concepts used in the Solace JavaScript API and Solace Node.js API:

Contexts

The Solace JavaScript API and Solace Node.js API use processing contexts for organizing communication between an application and a Solace event broker. Contexts act as containers in which zero or more sessions are created and session-related events can be handled. A context encapsulates threads that drive network I/O and message delivery notification for the sessions and session components associated with that context.

For more information on contexts in the Solace JavaScript API and Solace Node.js API, see Contexts.

Sessions

A session creates a single, client connection to an event broker for sending and receiving messages. When a context is established, one or more sessions can be created within that context.

A session provides the following primary services:

  • client connection

  • update and retrieve session properties

  • retrieve session statistics

  • add and remove subscriptions

  • create destinations and endpoints

  • publish and receive Direct messages

  • publish Guaranteed messages

For more information on sessions in the Solace JavaScript API and Solace Node.js API, see Sessions.

Flows

A consumer flow is an API object that allows applications to receive Guaranteed messages from an endpoint, such as a Queue. It is created by a session. To receive Guaranteed messages, a client must create a consumer flow within a session, and bind that flow to an endpoint on a Solace event broker that messages are published or attracted to.

For more information on flows in the Solace JavaScript API and Solace Node.js API, see Creating Flows.

Other helpful links: