harcon-amqp
Advanced tools
Comparing version 3.8.5 to 3.9.0
@@ -14,2 +14,4 @@ 'use strict' | ||
let SEPARATOR = '.' | ||
amqpbarrel.nodeNO = function ( comm ) { | ||
@@ -39,3 +41,3 @@ return _.isNumber( comm.valve ) ? comm.valve : Math.floor((Math.random() * this.nodeCount) + 1) | ||
// console.log('<><><>', division, entityName ) | ||
socket.connect( division, entityName + '.' + self.nodeSeqNo, function ( ) { | ||
socket.connect( division, entityName + SEPARATOR + self.nodeSeqNo, function ( ) { | ||
self.logger.harconlog( null, 'AMQP SUBSCRIBE socket is made.', { division: division, entity: entityName }, 'info' ) | ||
@@ -168,3 +170,3 @@ | ||
try { | ||
self.outs[ comm.sourceDivision ].publish( entityName + '.' + nodeNO, packet, 'utf8') | ||
self.outs[ comm.sourceDivision ].publish( entityName + SEPARATOR + nodeNO, packet, 'utf8') | ||
} catch (err) { | ||
@@ -193,7 +195,7 @@ self.logger.harconlog( err ) | ||
let entityName = comm.event.substring(0, comm.event.indexOf('.') ) | ||
let entityName = comm.event.substring(0, comm.event.indexOf( SEPARATOR ) ) | ||
let packet = JSON.stringify( { id: comm.id, comm: comm, nodeSeqNo: self.nodeSeqNo, callback: !!comm.callback } ) | ||
let nodeNO = comm.nodeSeqNo || self.nodeNO( comm ) | ||
try { | ||
self.outs[ comm.division ].publish( entityName + '.' + nodeNO, packet, 'utf8') | ||
self.outs[ comm.division ].publish( entityName + SEPARATOR + nodeNO, packet, 'utf8') | ||
} catch (err) { | ||
@@ -200,0 +202,0 @@ self.logger.harconlog( err ) |
{ | ||
"name": "harcon-amqp", | ||
"version": "3.8.5", | ||
"version": "3.9.0", | ||
"description": "AMQP plugin for the harcon messaging/service bus of node-based enterprise entities.", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"async": "^2.0.1", | ||
"harcon": "^4.8.5", | ||
"harcon": "^4.9.0", | ||
"isa.js": "^1.7.5", | ||
@@ -30,0 +30,0 @@ "rabbit.js": "^0.4.4" |
@@ -93,5 +93,6 @@ 'use strict' | ||
it('Retrieve listeners...', function (done) { | ||
inflicter.listeners( function (err, listeners) { | ||
console.log( '....', listeners ) | ||
expect( listeners ).to.eql( [ 'Inflicter', 'Publisher', 'peter', 'walter', 'Alizee', 'Claire', 'Domina', 'Julie', 'Marie' ] ) | ||
inflicter.entities( function (err, entities) { | ||
console.log( '....', entities ) | ||
let names = entities.map( function (entity) { return entity.name } ) | ||
expect( names ).to.eql( [ 'Inflicter', 'Publisher', 'peter', 'walter', 'Alizee', 'Claire', 'Domina', 'Julie', 'Marie' ] ) | ||
done(err) | ||
@@ -98,0 +99,0 @@ } ) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33565
890
Updatedharcon@^4.9.0