User Tools

Site Tools


sib:callers:azurecaller

AzureCaller

Overview

The AzureCaller SIB Caller subscribes to a topic on the mqtt and sends data to Azure storage.

Workflow

  • Subscribe: .custom/topic
    • on message:
      • custom.inputFormat
      • remove sibheader and send data to azure storage
      • Publish: msg._sibheader.responseTopic

Custom configuration

azurecaller/custom.js
var azureCallerCustom = {
    _id: "AzureStorageSample:1",
    _name: "Custom file for the Azure Storage caller",    
    inputFormat: (topic, msg, cb)=>{
        return cb(msg);
    },
    mqtt: "mqtt://localhost",
    topic: "SIB/AZURE/DATA",
    loggerCfg: {
	dest: {
	    file: false,
	    console: true,
	    mqtt: true
	}
    },
    container: "azureContainer",
    path: "path/to/file.txt",
    storageAccount: "bolentdl003",
    storageAccessKey: "phpX6+woHP/LE7jmhWgkWNu8krQFXV1bdy9zzVSPA1aSXRdbNVfvol6BCc5lCO8jGtihSegnl5klhHiIJ+vdrw=="
};
 
module.exports = azureCallerCustom;
  • _id: The unique ID of this service
  • _name: A plaintext description of this service
  • inputFormat(topic, msg, cb): The method that is run on service activation. The original message is passed as the argument and the return value from this method must be a JSON formatted message conforming to the SIB message standard.
  • loggerCfg: A JSON Object defining what logger actions should be active for this service (see Logger Configuration
  • path: The path in the Azure container to write to.
  • mqtt: The MQTT connection string for the internal MQTT transport
  • topic: The MQTT topic to subscribe to on the internal MQTT transport
  • container: The container in Azure to upload to
  • path: The path in the Azure container to write
  • storageAccount: The name of the Azure account
  • storageAccessKey: The access key for the storageAccount
sib/callers/azurecaller.txt · Last modified: 2019/03/27 10:05 by ozzy