Skip to content

Commit

Permalink
expose serverProperties in the connection object
Browse files Browse the repository at this point in the history
  • Loading branch information
jfromaniello committed Oct 8, 2018
1 parent 13741dd commit 0f77300
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ C.open = function(allFields, openCallback0) {
allFields.mechanism)));
return;
}
self.serverProperties = start.fields.serverProperties;
send(defs.ConnectionStartOk);
wait(afterStartOk);
}
Expand Down
11 changes: 11 additions & 0 deletions test/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ suite("Connect API", function() {
connect(u, {}, kCallback(fail(done), succeed(done)));
});

test("serverProperties", function(done) {
var url = require('url');
var parts = url.parse(URL, true);
var config = parts.query || {};
connect(config, {}, function(err, connection) {
if (err) { return done(err); }
assert.equal(connection.serverProperties.product, 'RabbitMQ');
done();
});
});

test("using custom heartbeat option", function(done) {
var url = require('url');
var parts = url.parse(URL, true);
Expand Down

0 comments on commit 0f77300

Please sign in to comment.