Results 1 to 2 of 2

Thread: adapter.js test

  1. #1

    adapter.js test

    Testing the adapter.js example from the web but it prompts error of testitemName not subscribe, any advise?

    var net = require('net'),
    reqRespStream = net.createConnection(8001, 'localhost'),
    notifyStream = net.createConnection(8002, 'localhost'),
    metadataStream = net.createConnection(8003, 'localhost');

    var MetadataProvider = require('lightstreamer-adapter').MetadataProvider,
    DataProvider = require('lightstreamer-adapter').DataProvider,
    dataProvider = new DataProvider(reqRespStream, notifyStream),
    metadataProvider = new MetadataProvider(metadataStream);

    dataProvider.on('subscribe', function(itemName, response) {
    //HERE start sending updates for the itemName item
    console.log("Subcribed item: " + itemName);

    dataProvider.on('unsubscribe', function(itemName, response) {
    //HERE stop sending updates for the itemName item
    console.log("Unsubscribed item: " + itemName);

    metadataProvider.on('notifyUserMessage', function(request, response) {
    //HERE handle user message

    dataProvider.update("testitemName", false, {
    'field1': "valField1",
    'field2': "valField2"


    C:\Lightstreamer\adapters\NodeAdapter\node_modules \lightstreamer-adapter\lib\dataprovider.js:351
    throw new Error('Item [' + itemName + '] is not subscribed');
    Error: Item [testitemName] is not subscribed
    at getIdFromItemName (C:\Lightstreamer\adapters\NodeAdapter\node_module s\lightstreamer-adapter\lib\dataprovider.js:3
    at EventEmitter.update (C:\Lightstreamer\adapters\NodeAdapter\node_module s\lightstreamer-adapter\lib\dataprovider.js
    at Object.<anonymous> (C:\Lightstreamer\adapters\NodeAdapter\adapters.js :30:14)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

  2. #2
    Power Member
    Join Date
    Jul 2006
    Cesano Maderno, Italy
    Hi Loki,

    You are right the for the Node Adapters is a misleading.
    You can't actually send an update to an item until a client subscribed to such item.
    I suggest you to start from the hello world example located here:

    In the meanwhile I will fix the readme.



Similar Threads

  1. Stress Test / Performance
    By rmusco in forum General
    Replies: 5
    Last Post: January 4th, 2013, 01:38 AM
  2. MOBILE DEVICES: add your compatibility test here
    By Alessandro in forum Client SDKs
    Replies: 7
    Last Post: May 8th, 2011, 11:26 AM
  3. MOBILE DEVICES: add your compatibility test here
    By Alessandro in forum Client SDKs
    Replies: 2
    Last Post: October 6th, 2009, 10:57 PM
  4. Performance test for Lightstreamer
    By quanhm in forum General
    Replies: 1
    Last Post: May 19th, 2008, 10:48 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT +1. The time now is 09:11 AM.