Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ibmiotf

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibmiotf - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

samples/sharedSubscriptionSample.js

8

dist/clients/ApplicationClient.js

@@ -83,3 +83,9 @@ (function (global, factory) {

this.apiToken = config['auth-token'];
this.mqttConfig.clientId = "a:" + config.org + ":" + config.id;
//support for shared subscription
this.shared = (config['type'] + '').toLowerCase() === "shared" || false;
if (this.shared) {
this.mqttConfig.clientId = "A:" + config.org + ":" + config.id;
} else {
this.mqttConfig.clientId = "a:" + config.org + ":" + config.id;
}
this.subscriptions = [];

@@ -86,0 +92,0 @@

2

package.json
{
"name": "ibmiotf",
"version": "0.2.8",
"version": "0.2.9",
"description": "A library for developing device and application clients for IBM Internet of Things Foundation",

@@ -5,0 +5,0 @@ "main": "dist/iotf-client.js",

@@ -261,2 +261,3 @@ Node.js Client Library

- auth-token - API key token
- type - use 'shared' to enable shared subscription

@@ -322,3 +323,30 @@ If you want to use quickstart, then send only the first two properties.

Shared Subscription
---------------------
Use this feature to build scalable applications which will load balance messages across multiple instances of the application. To enable this, pass 'type' as 'shared' in the configuration.
``` {.sourceCode .javascript}
var appClientConfig = {
org: 'xxxxx',
id: 'myapp',
"auth-key": 'a-xxxxxx-xxxxxxxxx',
"auth-token": 'xxxxx!xxxxxxxx',
"type" : "shared" // make this connection as shared subscription
};
var appClient = new Client.IotfApplication(appClientConfig);
appClient.connect();
appClient.on("connect", function () {
//Add your code here
});
appClient.on("error", function (err) {
console.log("Error : "+err);
});
....
```
Handling errors

@@ -325,0 +353,0 @@ ------------------

@@ -52,3 +52,9 @@ /**

this.apiToken = config['auth-token'];
this.mqttConfig.clientId = "a:" + config.org + ":" + config.id;
//support for shared subscription
this.shared = ((config['type']+'').toLowerCase() === "shared") || false;
if(this.shared) {
this.mqttConfig.clientId = "A:" + config.org + ":" + config.id;
} else {
this.mqttConfig.clientId = "a:" + config.org + ":" + config.id;
}
this.subscriptions = [];

@@ -55,0 +61,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc