Skip to content

Commit

Permalink
[Dev-286] MQTT: Add logging
Browse files Browse the repository at this point in the history
[Dev-287] MQTT: Add processes monitoring
Slight improvements
  • Loading branch information
itrambovetskyi committed Oct 31, 2017
1 parent 3dc1054 commit 293d1e3
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/broker.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ const server = new mosca.Server({
subscriptions: CONST.PERSISTENCE.MAX_NUMBER_OF_SUBSCRIPTIONS,
packets: CONST.PERSISTENCE.MAX_NUMBER_OF_PACKETS
}
},
backend: {
type: 'redis',
db: 12,
port: REDIS_SERVER_PORT,
host: REDIS_SERVER_HOST,
return_buffers: true
}
});

Expand Down Expand Up @@ -116,8 +109,7 @@ server.authorizePublish = function (client, topic, payload, callback) {

server.authorizeForward = function (client, packet, callback) {
const topicStructure = new TopicStructure(packet.topic);
const isMessageFromThisBroker = topicStructure.isDH() ? wsManager.hasKey(client.id) : true;
const isAuthorized = topicStructure.hasOwner() ? topicStructure.getOwner() === client.id : isMessageFromThisBroker;
const isAuthorized = topicStructure.hasOwner() ? topicStructure.getOwner() === client.id : true;

isAuthorized === true ?
appLogger.debug(`client with id: "${client.id}" has been authorized for receiving packet on the topic: "${packet.topic}"`) :
Expand Down

0 comments on commit 293d1e3

Please sign in to comment.