lightstreamer-jms-client

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

Package Sidebar

Install

npm i lightstreamer-jms-client

Weekly Downloads

2

Version

1.2.1

License

none

Last publish

Collaborators

  • lightstreamer
  • dario-ls
  • acarioni
  • giuseppe.corti