Skip to content

tepafoo/node-stomp-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stomp Client

Build Status

A node.js STOMP client. Props goes to Russell Haering for doing the initial legwork.

The following enhancements have been added:

  • Unit tests
  • Ability to support different protocol versions (1.0 or 1.1) - more work needed
  • Inbound frame validation (required / regex'able header values)
  • Support for UNSUBSCRIBE frames in client
  • Ability to add custom headers to SUBSCRIBE/UNSUBSCRIBE frames

Installation

npm install stomp-client

Super basic example

var Client = require('stomp-client').StompClient;
var destination = '/queue/someQueueName';

var client = new Client('127.0.0.1', 2098, 'user', 'pass', '1.0');

client.connect(function(sessionId) {
	client.subscribe(destination, function(body, headers) {
		console.log('This is the body of a message on the subscribed queue:', body);
	});

	client.publish(destination, 'Oh herrow');
});

The client comes in two forms, a standard or secure client. The example below is using the standard client. To use the secure client simply change StompClient to SecureStompClient.

About

A STOMP client for Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%