🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

lightstreamer-jms-client

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightstreamer-jms-client

This package includes the resources needed to write a client for Lightstreamer JMS Extender.

1.2.1
latest
npm
Version published
Weekly downloads
1
-75%
Maintainers
1
Weekly downloads
 
Created
Source

Lightstreamer JMS Extender Client

Use

Install the package using npm

npm install lightstreamer-jms-client

Create a Topic Connection and connect

var ls = require('lightstreamer-jms-client');
ls.TopicConnectionFactory.createTopicConnection("http://localhost:8080/", "HornetQ", null, null, {
  onConnectionCreated: function(conn) {
    var topicSession= conn.createSession(false, "PRE_ACK");
    .....
    conn.start();
  }
});

Create a Topic Subscription and send it to the server

var topic= topicSession.createTopic("stocksTopic");
var consumer= topicSession.createConsumer(topic, null);

Listen for messages

consumer.setMessageListener({
  onMessage: function(message) {
    var feedMessage= message.getObject();
    var key= feedMessage.itemName;
    var values= feedMessage.currentValues;
    console.log(values["stock_name"] + ": " + values["last_price"]);
  }
});

For further details check the API, the Developer Guide and the available examples

Keywords

lightstreamer

FAQs

Package last updated on 11 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts