1.0.0 • Published 4 years ago

stompit v1.0.0

Weekly downloads
5,420
License
MIT
Repository
github
Last release
4 years ago

stompit Build Status

A STOMP client library for Node.js that is fully compatible with STOMP 1.0, 1.1 and 1.2 servers. The library provides optional fault tolerance features such as multiple server failover and persistent subscriptions and message publishing across failure events. The API is designed to be consistent with idiomatic Node.js code. Messages are stream oriented. The client supports any stream.Duplex transport, such as for example tls.TLSSocket.

An example of sending and receiving a message using the client API:

const stompit = require('stompit');

const connectOptions = {
  'host': 'localhost',
  'port': 61613,
  'connectHeaders':{
    'host': '/',
    'login': 'username',
    'passcode': 'password',
    'heart-beat': '5000,5000'
  }
};

stompit.connect(connectOptions, function(error, client) {
  
  if (error) {
    console.log('connect error ' + error.message);
    return;
  }
  
  const sendHeaders = {
    'destination': '/queue/test',
    'content-type': 'text/plain'
  };
  
  const frame = client.send(sendHeaders);
  frame.write('hello');
  frame.end();
  
  const subscribeHeaders = {
    'destination': '/queue/test',
    'ack': 'client-individual'
  };
  
  client.subscribe(subscribeHeaders, function(error, message) {
    
    if (error) {
      console.log('subscribe error ' + error.message);
      return;
    }
    
    message.readString('utf-8', function(error, body) {
      
      if (error) {
        console.log('read message error ' + error.message);
        return;
      }
      
      console.log('received message: ' + body);
      
      client.ack(message);
      
      client.disconnect();
    });
  });
});

Install

npm install --save stompit

Documentation

1.0.0

4 years ago

0.26.0

6 years ago

0.25.0

7 years ago

0.24.0

7 years ago

0.23.0

8 years ago

0.22.0

9 years ago

0.21.0

9 years ago

0.20.0

9 years ago

0.19.0

10 years ago

0.18.3

10 years ago

0.18.2

10 years ago

0.18.1

10 years ago

0.18.0

10 years ago

0.17.0

10 years ago

0.16.0

10 years ago

0.15.0

10 years ago

0.14.0

11 years ago

0.13.0

11 years ago

0.12.1

11 years ago

0.12.0

11 years ago

0.11.0

11 years ago

0.10.2

11 years ago

0.10.1

11 years ago

0.10.0

11 years ago

0.9.0

11 years ago

0.8.4

11 years ago

0.8.3

11 years ago

0.8.2

11 years ago

0.8.1

11 years ago

0.8.0

11 years ago

0.7.0

11 years ago

0.6.2

11 years ago

0.6.1

11 years ago

0.6.0

11 years ago

0.5.0

11 years ago

0.4.0

11 years ago

0.3.3

11 years ago

0.3.2

11 years ago

0.3.1

11 years ago

0.2.1

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago