npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

solclientjs

v10.17.1

Published

Solace Messaging API for Node.js

Downloads

32,555

Readme

Solace Javascript Messaging API

Copyright 2011-2024 Solace Corporation. All rights reserved.

This software is proprietary software of Solace Corporation and intended only for use in conjunction with one or more Solace Message Routers. By using this software, you are agreeing to the license terms and conditions located at https://solace.com/license-software.

INTRODUCTION

This API allows Node.js, browser and mobile applications to send and receive messages to and from a Solace Messaging Router.

PLATFORMS

The API supports two platforms:

  • Node.js
  • Browser

PACKAGING

The API is distributed either as the solclientjs package in the npm registry or as a downloadable tar.gz package named npm-solclientjs-<version>.tar.gz. The package includes:

  • /lib Module files for Node.js platform
  • /lib-browser Module files for Browser platform

DOCUMENTATION

The docs for the solclientjs API is no longer distributed within this package but can be found online here:

  • API online docs for Node.js platform
  • API online docs for Browser platform

You can find additional resources about Solace development and ask questions within the Solace developer community here: Solace Developer Community

INSTALLATION

To install Solclientjs, with Node.js installed and npm present in your path:

From the NPM registry

  1. Change directory to where solclientjs will be installed
  2. If package.json does not exist in the directory, create one with: > npm init
  3. Install solclientjs: > npm install solclientjs

From the downloadable package

  1. Change directory to where solclientjs will be installed
  2. If package.json does not exist in the directory, create one with: > npm init
  3. Install solclientjs: > npm install <path_to_package>/npm-solclientjs-<version>.tar.gz

SAMPLES

Tutorials and samples with detailed instructions how to run them, are available on GitHub.

Samples for the Node.js platform are available from the following location: Solace Samples: Node.js

Samples for the Browser platform are available from the following location: Solace Samples: JavaScript

API VARIATIONS

There are different variations of the API that can be used. The differences between them include available logging verbosity and whether or not the API has been minified.

When the available logging verbosity has been reduced, this is done to improve the performance the application but this reduces the ability to debug problems.

Minified libraries are both smaller and optimized for performance. However, this comes at the expense of making debugging more difficult.

The following table summarizes the available API variations:

| Variation  | Minified | Available Logs           |
-------------|----------|---------------------------
| Debug      | No       | All                      |
| Full       | No       | INFO, WARN, ERROR, FATAL |
| Production | Yes      | INFO, WARN, ERROR, FATAL |

Node.js API Loading

To load a Node.js API variation, use one of the following statements:

    var solace = require('solclientjs');            // loads production
OR  var solace = require('solclientjs').production; // loads production
OR  var solace = require('solclientjs').full;       // loads full
OR  var solace = require('solclientjs').debug;      // loads debug

Browser API Loading

There are several different ways to load a Browser API variation.

If a bundling tool such as Webpack is used to bundle the API dependency with ES6 module loader, use one of the following statements:

   import solace from 'solclientjs';                             // loads production
OR import solace from 'solclientjs/lib-browser/solclient';       // loads production
OR import solace from 'solclientjs/lib-browser/solclient-full';  // loads full
OR import solace from 'solclientjs/lib-browser/solclient-debug'; // loads debug

If a bundling tool such as Browserify is used to bundle the API dependency with CommonJS module loader, use one of the following statements:

   var solace = require('solclientjs');                             // loads production
OR var solace = require('solclientjs/lib-browser/solclient');       // loads production
OR var solace = require('solclientjs/lib-browser/solclient-full');  // loads full
OR var solace = require('solclientjs/lib-browser/solclient-debug'); // loads debug

If the API is directly included in the HTML file, to load an API variation, use one of the following statements:

<head>
    <script src="solclient.js"></script>       <!-- production -->
OR  <script src="solclient-full.js"></script>  <!-- full       -->
OR  <script src="solclient-debug.js"></script> <!-- debug      -->
</head>

API PROFILES

The API has the concept of an initialization profile. The intent of the profile is to allow old applications to remain compatible with old versions of the API, while allowing new users to take advantage of new recommended defaults.

When writing a new application, it is recommended to choose the newest factory profile. For example, if version10 is the newest available factory profile, this snippet demonstrates how to initialize the API:

var factoryProps = new solace.SolclientFactoryProperties();
factoryProps.profile = solace.SolclientFactoryProfiles.version10;
solace.SolclientFactory.init(factoryProps);

For backwards compatibility with applications written before the concept of API profiles were introduced, the default profile is version7.

IMPORTANT: solace.SolclientFactory.init should be called before any other API function is invoked.

LOGGING

The default log level of the API is INFO. If you want to change the log level, use the solace.SolclientFactory#setLogLevel method after calling solace.SolclientFactory#init

CODE SNIPPETS

The following code snippets show how to load the debug API, select the version10 API profile, and set the log level to TRACE, the most verbose log level.

Snippets for both Node.js platform and Browser platform have been provided.

Node.js Code Snippet

var solace = require('solclientjs').debug;
var properties = new solace.SolclientFactoryProperties();
properties.profile = solace.SolclientFactoryProfiles.version10;
solace.SolclientFactory.init(properties);
solace.SolclientFactory.setLogLevel(solace.LogLevel.TRACE);

Browser Code Snippet

If a bundling tool such as Webpack or Browserify is used to bundle the API dependency:

import solace from 'solclientjs/lib-browser/solclient-debug';
OR
var solace = require('solclientjs/lib-browser/solclient-debug');

var properties = new solace.SolclientFactoryProperties();
properties.profile = solace.SolclientFactoryProfiles.version10;
solace.SolclientFactory.init(properties);
solace.SolclientFactory.setLogLevel(solace.LogLevel.TRACE);

If the API is directly included in HTML file:

<head>
    <script src="solclient-debug.js"></script>
    <script type="text/javascript">
        var properties = new solace.SolclientFactoryProperties();
        properties.profile = solace.SolclientFactoryProfiles.version10;
        solace.SolclientFactory.init(properties);
        solace.SolclientFactory.setLogLevel(solace.LogLevel.TRACE);
    </script>
</head>