Wondering what’s next for npm?Check out our public roadmap! »

lightstreamer-jms-clientTypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

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

Install

npm i lightstreamer-jms-client

DownloadsWeekly Downloads

2

Version

1.2.1

License

none

Last publish

Collaborators

  • avatar