NodeJs Client for HelloWorld
Feb 7, 2013
I'm trying (and failing) to write a nodejs client for the helloworld tutorial using voltdb 3.0. I have installed the npm package voltjs, and have been unable to connect.
The DB is running on localhost with this command:
$ voltdb create catalog helloworld.jar deployment deployment.xml host localhost
My minimal client to connect looks like this:
$ cat helloclient.js
var VoltClient = require('voltjs/lib/client')
, VoltConstants = require('voltjs/lib/voltconstants')
;
var config = [{ host: "localhost", messageQueueSize: 20 }];
var client = new VoltClient(config);
client.connect(function(code, evt, results) {
console.log("connect code: " + VoltConstants.STATUS_CODE_STRINGS
The DB is running on localhost with this command:
$ voltdb create catalog helloworld.jar deployment deployment.xml host localhost
My minimal client to connect looks like this:
$ cat helloclient.js
var VoltClient = require('voltjs/lib/client')
, VoltConstants = require('voltjs/lib/voltconstants')
;
var config = [{ host: "localhost", messageQueueSize: 20 }];
var client = new VoltClient(config);
client.connect(function(code, evt, results) {
console.log("connect code: " + VoltConstants.STATUS_CODE_STRINGS
);
}, function(results) {
console.log("Error " + results);
});
I would expect a successful connection to call the first function, and an error to call the second, however, running it I see the first is called with an error:
$ node helloclient.js
connect code: UNEXPECTED_FAILURE
Questions:
* Why would a failure NOT call the error callback
* Is a license.xml file required for voltdb 3.0 - the documentation shows starting commands with a licsense param, but I have none in my installation dir?
* Why is it failing to connect?
* I think the deployment.xml needs jsonapi support, is this true? (I included it)
* Is something additional needed on the command line for node clients?
* Is there a log that gives any connect info?
* Are nodejs clients supported in the Community Edition?
TIA
jeff