User Tools

Site Tools


sib:callers:mqttcaller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
sib:callers:mqttcaller [2019/09/20 07:25]
hubbe
sib:callers:mqttcaller [2020/01/15 15:49] (current)
hubbe
Line 8: Line 8:
  
 |Module|sib_mqttcaller| |Module|sib_mqttcaller|
-|Version|1.3.3|+|Version|1.3.4|
  
 ==== Workflow ==== ==== Workflow ====
Line 46: Line 46:
  inputFormat:​ (topic, msg, callback)=>​{  inputFormat:​ (topic, msg, callback)=>​{
  msg.fmtData = "Data has been formatted and modified";​  msg.fmtData = "Data has been formatted and modified";​
- callback(msg);​+ callback(msg, {});
  },  },
  loggerCfg: {  loggerCfg: {
Line 74: Line 74:
   * _name: A plaintext description of this service   * _name: A plaintext description of this service
   * init(thisCaller):​ If defined this method is executed when the service is starting up as the last step of initialization. //​thisCaller//​ is a reference to the instance of the caller that does the method call.   * init(thisCaller):​ If defined this method is executed when the service is starting up as the last step of initialization. //​thisCaller//​ is a reference to the instance of the caller that does the method call.
-  * inputFormat(topic,​ msg, callback): The method that is run on service activation. The original message is passed as the argument and the input value to the callback must be a JSON formatted message conforming to the SIB message standard.+  * inputFormat(topic,​ msg, callback): The method that is run on service activation. The original message is passed as the argument and the input value to the callback must be a JSON formatted message conforming to the SIB message standard. An optional second argument was added to the callback in version 1.3.4 //options// being the same options parameter as used in the mqtt.publish method.
   * loggerCfg: A JSON Object defining what logger actions should be active for this service (see [[sib:​loggerConfiguraton|Logger Configuration]]   * loggerCfg: A JSON Object defining what logger actions should be active for this service (see [[sib:​loggerConfiguraton|Logger Configuration]]
   * outputFormat(topic,​ msg, callback): This message is run on the response data before publishing to the response topic. The response message is passed as the argument and the input to the callback must be a JSON formatted message conforming to the SIB message standard.   * outputFormat(topic,​ msg, callback): This message is run on the response data before publishing to the response topic. The response message is passed as the argument and the input to the callback must be a JSON formatted message conforming to the SIB message standard.
sib/callers/mqttcaller.txt ยท Last modified: 2020/01/15 15:49 by hubbe