-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
60 lines (48 loc) · 1.66 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var functionfactory = require('./build/Release/xmsbridge');
var asyncWorker = require('./build/Release/xmsbridgeAsync');
var http = require('http');
var options = {
host: 'localhost',
path: '/',
//since we are listening on a custom port, we need to specify it by hand
port: '9099',
//This is what changes the request to a POST request
method: 'POST'
};
var callback = function(response) {
console.log("success");
}
var messageListener1 = functionfactory.CreateListenerConfig(
"ServCon","localhost","1414","QM_idea_PC","queue://sample","theThree",
function(err,val){
console.log("dandanakka");
console.log(val);
var req = http.request(options, callback);
req.write(val);
req.end();
});
functionfactory.StartListener(messageListener1);
var messageListener2 = functionfactory.CreateListenerConfig(
"ServCon","localhost","1414","QM_idea_PC","queue://default","Musketeer",
function(err,val){
console.log("dandanakka2");
console.log(val);
});
functionfactory.StartListener(messageListener2);
asyncWorker.asyncReceiver("ServCon","localhost","1414","QM_idea_PC","queue://postcard",function(err,val){
console.log(val);
});
var server = http.createServer(function(request, response) {
console.log("Done here");
response.writeHead(200, { "Content-Type": "text/plain" });
response.end("Good");
response = null;
});
console.log("Starting up the server");
server.listen(9099);
//var status = functionfactory.PrintConfig(messageListener);
/*console.log(messageConsumer("ServCon","localhost","1414","QM_idea_PC","queue://sample", function(err,val){
console.log(err);
console.log(val);
}));
console.log("me first");*/