Skip to content
This repository was archived by the owner on Nov 28, 2018. It is now read-only.

Commit 3c415a0

Browse files
committed
Clean up README for accuracy
1 parent 3c1b46f commit 3c415a0

File tree

1 file changed

+5
-82
lines changed

1 file changed

+5
-82
lines changed

README.md

Lines changed: 5 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -4,96 +4,19 @@ stomp-js
44
## Overview
55

66
An exercise with node.js to implement the STOMP protocol.
7-
The design & implementation is heavily inspired by [python-stomp](http://bitbucket.org/benjaminws/python-stomp/), with an evented twist.
87

9-
This is merely the first iteration; a complete spike. I will be rewriting it from the ground up with BDD.
8+
For documentation see doc/stomp.md and doc/frame.md
109

1110
## Examples
1211

1312
### Consumer
1413

15-
#!/usr/bin/env node
16-
17-
var stomp = require('./lib/stomp');
18-
19-
var stomp_args = {
20-
port: 61613,
21-
host: 'localhost',
22-
debug: true
23-
}
24-
// Could also add..
25-
//{login: 'bah', password: 'bah'}
26-
27-
var client = new stomp.Stomp(stomp_args);
28-
29-
var headers = {
30-
destination: '/queue/test_stomp',
31-
ack: 'client'
32-
};
33-
34-
var messages = [];
35-
36-
client.connect();
37-
38-
client.on('connected', function() {
39-
client.subscribe(headers);
40-
console.log('Connected');
41-
});
42-
43-
client.on('message', function(message) {
44-
messages.push(message);
45-
});
46-
47-
client.on('error', function(error_frame) {
48-
console.log(error_frame.body);
49-
});
50-
51-
process.on('SIGINT', function() {
52-
console.log('\nConsumed ' + messages.length + ' messages');
53-
client.disconnect();
54-
});
14+
See stomp-consumer.js
5515

5616
### Producer
5717

58-
#!/usr/bin/env node
59-
60-
var stomp = require('./lib/stomp');
61-
62-
var num = process.argv[2];
63-
64-
var stomp_args = {
65-
port: 61613,
66-
host: 'localhost',
67-
debug: true
68-
}
69-
// Could also add..
70-
//{login: 'bah', password: 'bah'}
71-
72-
var client = new stomp.Stomp(stomp_args);
73-
74-
var queue = '/queue/test_stomp';
75-
76-
client.connect();
77-
78-
client.on('connected', function() {
79-
if (!num) num = 10;
80-
81-
for (var i = 0; i < num; i++) {
82-
console.log(i);
83-
client.send({
84-
'destination': queue,
85-
'body': 'Testing' + i,
86-
'persistent': 'true'
87-
});
88-
}
89-
client.disconnect();
90-
});
18+
See stomp-producer.js
9119

92-
client.on('error', function(error_frame) {
93-
console.log(error_frame.body);
94-
client.disconnect();
95-
});
20+
### Producer with Transaction Support
9621

97-
process.on('SIGINT', function() {
98-
client.disconnect();
99-
});
22+
See stomp-producer-txn.js

0 commit comments

Comments
 (0)