InfluxDB errors - q-gate and check InfluxDB write is completed OK

Hi,

I am looking for some pointers if possible please.

As my Home Control flow application has got more complicated, I am suffering more and more from errors with InfluxDB.

[error] [influxdb in:bf343c7a.e41d4] Error: connect ECONNREFUSED 127.0.0.1:8086
or
[error] [influxdb out:c4933f01.c82b4] Error: No host available

I have read about problems writing in dribs and drabs and that Batch writing is better, but it seems the InfluxDB Batch mode doesn't appear to be working at the moment. So, I have tried to adapt Colin's flow (Thank You for this!) which incorporates q-gate.

The problem I am having, is that InfluxDB doesn't appear to give an operation successful message, or at least, I can't find one, or envisage a way of getting the success status.

Any suggestions gratefully received!!

Colin J

Node-RED all up to date - 1.1.3
All nodes up to date.

A Catch node does seem to catch errors, but unfortunately it does not seem to support the Complete node feature that you should be able to use to indicate ok. It apparently hasn't been added to that node yet.
You could submit an issue asking for it to be added on the node's github page, but in the meantime I think you would have to do the influx writing 'by hand' using http, which I gather is quite simple. I haven't looked at it myself but this flow is the sort of thing you would need I think.

I haven't had any problems with it, if you detail the problem someone may be able to help.
However I imagine that node suffers from the same problem, so you wouldn't solve the problem that way would you?

Is your influx server running on the same machine as node red? Is it highly stressed at times?

1 Like

Thank you for your reply, much appreciated.

So, I will ask if the Complete feature can be added to the InfluxDB Node and investigate the HTTP route (already done this with MQTT). I will check the flow out.

Ah, saw a thread earlier, revisited but may have been due to 'finger trouble'. Agreed, different solution needed.

Setup is an RPi 3B+ booting from SSD (seems quicker than SD card) running only Node RED, InfluxDB, Grafana and Mosquitto. Talks to Opto22 PAC R1 using the NodeRED nodes and an ESP8266 through Mosquitto. This server load averages at 0.99 (tops).

Thinking of making it an RPi 4B 2GB.

I will of course let you know how I get on. May take a few days!

So, success!

Back to the server load, should have been an average of 0.59, not 0.99! Teach me to not do several things at once!!

After playing around and trying to .slice an Object, I can now get the data into the the databse using the HTTP method. Also added request for the Complete Node support on GitHub.

Thank you @Colin for your suggestion.

For reference...

[{"id":"e3caed31.90d29","type":"function","z":"a3c1f642.060128","name":"humidity","func":"var LRhum = parseFloat(msg.PACFloatsTable[6].toFixed(2));\nvar Bedshum = parseFloat(msg.PACFloatsTable[11].toFixed(2));\nreturn {measurement:\"humidity\", payload:{Beds_Hum:Bedshum, LR_Hum:LRhum}};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":80,"wires":[["97602d44.5ed6b8"]]},{"id":"5e75a158.978e7","type":"function","z":"a3c1f642.060128","name":"Other","func":"var press = parseFloat(msg.PACFloatsTable[12].toFixed(2));\n//var light = msg.PACFloatsTable[11].toFixed(2));\nvar light = Number(msg.BedsLux);\nreturn {measurement:\"Other\", payload:{Beds_2:press, Beds2_light:light}};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":120,"wires":[["97602d44.5ed6b8"]]},{"id":"21555e8f.2378d2","type":"function","z":"a3c1f642.060128","name":"temps","func":"\nvar temp = parseFloat(msg.PACFloatsTable[5].toFixed(2));\nvar out = parseFloat(msg.PACFloatsTable[0].toFixed(2));\nvar BIn = parseFloat(msg.PACFloatsTable[1].toFixed(2));\nvar BOut = parseFloat(msg.PACFloatsTable[2].toFixed(2));\nvar HW = parseFloat(msg.PACFloatsTable[3].toFixed(2));\nvar Beds = parseFloat(msg.PACFloatsTable[10].toFixed(2));\nvar cloaks = parseFloat(msg.PACFloatsTable[15].toFixed(2));\nvar box1 = parseFloat(msg.PACFloatsTable[20].toFixed(2));\n\nvar setCH = parseFloat(msg.PACInt32Table[2].toFixed(2));\nvar setHW = parseFloat(msg.PACInt32Table[3].toFixed(2));\nvar setBeds = parseFloat(msg.PACInt32Table[4].toFixed(2));\nvar BoilSet = parseFloat(msg.PACInt32Table[6].toFixed(2));\n\nreturn {measurement:\"temperature\", payload:{Bedroom_1:Beds, Boiler_In:BIn, Boiler_Out:BOut, Boiler_Set:BoilSet, Box1:box1, Cloaks:cloaks, Hot_Water:HW, LR_Temp:temp, Outside:out, Set_Beds:setBeds, Set_Temp:setCH, Set_Water:setHW}};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":40,"wires":[["97602d44.5ed6b8","86a729cf.965608"]]},{"id":"d6ed4b4.f57d9b8","type":"function","z":"a3c1f642.060128","name":"BME680","func":"\nvar BMEtemp = parseFloat(msg.PACFloatsTable[15].toFixed(2));\nvar BMEhumidity = parseFloat(msg.PACFloatsTable[16].toFixed(2));\nvar BMEdewpoint = parseFloat(msg.PACFloatsTable[17].toFixed(2));\nvar BMEpressure = parseFloat(msg.PACFloatsTable[18].toFixed(2));\nvar BMEgas = parseFloat(msg.PACFloatsTable[19].toFixed(2));\nglobal.set('BMEGas',msg.PACFloatsTable[19]);\nvar BMEilluminance1 = parseFloat(msg.PACFloatsTable[24].toFixed(2));\nvar BMEtemp1 = parseFloat(msg.PACFloatsTable[20].toFixed(2));\nvar BMEhumidity1 = parseFloat(msg.PACFloatsTable[21].toFixed(2));\nvar BMEpressure1 = parseFloat(msg.PACFloatsTable[23].toFixed(2));\n\nreturn {measurement:\"bme680\", payload:{BME_Humidity:BMEhumidity, BME_DewPoint:BMEdewpoint, BME_Gas:BMEgas, BME_Humidity1:BMEhumidity1, BME_Illuminance1:BMEilluminance1, BME_Pressure:BMEpressure, BME_Pressure1:BMEpressure1, BME_Temp:BMEtemp, BME_Temp1:BMEtemp1\n}};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":160,"wires":[["97602d44.5ed6b8"]]},{"id":"86a729cf.965608","type":"debug","z":"a3c1f642.060128","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":40,"wires":[]},{"id":"fcba98e.40d46e8","type":"inject","z":"a3c1f642.060128","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"Start","payload":"","payloadType":"str","x":190,"y":480,"wires":[["db826084.b376b8"]]},{"id":"8037a9d2.dad818","type":"complete","z":"a3c1f642.060128","name":"","scope":["3bd18aeb.6f418e","4c6830b1.0f31f8"],"uncaught":false,"x":630,"y":640,"wires":[["ce659bc5.76c25","a2651a7a.07532"]]},{"id":"a8063e77.354578","type":"catch","z":"a3c1f642.060128","name":"","scope":["3bd18aeb.6f418e","4c6830b1.0f31f8"],"uncaught":false,"x":630,"y":680,"wires":[["1306e3c0.512bc4","9154db85.b9ee28"]]},{"id":"eaf46739.b3547","type":"q-gate","z":"a3c1f642.060128","name":"","controlTopic":"control","defaultState":"queueing","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","peekCmd":"peek","dropCmd":"","statusCmd":"","maxQueueLength":"100","keepNewest":false,"qToggle":false,"persist":true,"x":650,"y":240,"wires":[["ccbcb263.b495a8"]]},{"id":"11226cb7.59f1c3","type":"switch","z":"a3c1f642.060128","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Waiting_for_messages_in_queue","vt":"str"},{"t":"eq","v":"Waiting_for_message","vt":"str"},{"t":"eq","v":"Dropping_from_queue","vt":"str"},{"t":"eq","v":"Sending","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":577,"y":471,"wires":[["a3b51140.28ee88"],["492ce4eb.f90f54"],["fea63e8c.348138"],["fabed9dc.1a285","2a839e08.f96802"]]},{"id":"492ce4eb.f90f54","type":"change","z":"a3c1f642.060128","name":"Peek oldest message","rules":[{"t":"set","p":"payload","pt":"msg","to":"peek","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":828,"y":401,"wires":[["eaf46739.b3547"]]},{"id":"ccbcb263.b495a8","type":"change","z":"a3c1f642.060128","name":"Save and set topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"Message","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":240,"wires":[["db826084.b376b8"]]},{"id":"fabed9dc.1a285","type":"change","z":"a3c1f642.060128","name":"Restore topic","rules":[{"t":"move","p":"topic_saved","pt":"msg","to":"topic","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":480,"wires":[[]]},{"id":"fea63e8c.348138","type":"change","z":"a3c1f642.060128","name":"Drop oldest message","rules":[{"t":"set","p":"payload","pt":"msg","to":"drop","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":857,"y":436,"wires":[["eaf46739.b3547"]]},{"id":"1306e3c0.512bc4","type":"change","z":"a3c1f642.060128","name":"Failed","rules":[{"t":"set","p":"topic","pt":"msg","to":"Failed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":680,"wires":[["db826084.b376b8"]]},{"id":"ce659bc5.76c25","type":"change","z":"a3c1f642.060128","name":"Success","rules":[{"t":"set","p":"topic","pt":"msg","to":"Success","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":640,"wires":[["db826084.b376b8"]]},{"id":"dbdea520.cec968","type":"status","z":"a3c1f642.060128","name":"","scope":["eaf46739.b3547"],"x":648,"y":177,"wires":[["f0850a30.a59ba8"]]},{"id":"f0850a30.a59ba8","type":"function","z":"a3c1f642.060128","name":"Messages in queue?","func":"// expects msg.status.text in form \"queuing: <number>\"\n// sends \"Messages_in_queue\" if > 0 messages\nvalue = parseInt(msg.status.text.split(\":\")[1])\nif (value > 0) {\n    msg.topic = \"Messages_in_queue\"\n    msg.payload = value\n} else {\n    msg = null\n}\nreturn msg;","outputs":1,"noerr":0,"x":836,"y":177,"wires":[["db826084.b376b8"]]},{"id":"a3b51140.28ee88","type":"change","z":"a3c1f642.060128","name":"Messages in queue?","rules":[{"t":"set","p":"payload","pt":"msg","to":"status","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":787,"y":364,"wires":[["eaf46739.b3547"]]},{"id":"db826084.b376b8","type":"dsm","z":"a3c1f642.060128","name":"email dsm","sm_config":"{\n    \"currentState\": \"Initialise\",\n    \"states\": {\n        \"Initialise\": {\n            \"Start\": \"Waiting_for_messages_in_queue\"\n        },\n        \"Waiting_for_messages_in_queue\": {\n            \"Messages_in_queue\": \"Waiting_for_message\"\n        },\n        \"Waiting_for_message\": {\n            \"Message\": \"Sending\"\n        },\n        \"Sending\": {\n            \"Success\": \"Dropping_from_queue\",\n            \"Failed\": \"Long_waiting\"\n        },\n        \"Dropping_from_queue\": {\n            \"Timeout\": \"Waiting_for_messages_in_queue\"\n        },\n        \"Long_waiting\": {\n            \"Timeout\": \"Waiting_for_messages_in_queue\"\n        }\n    },\n    \"data\": {\n        \"timeoutTime\": 15000\n    },\n    \"methods\": {\n        \"onTransition\": [\n            \"sm.data.timeoutTime = sm.currentState == 'Long_waiting' ? 1000 : 5000;\",\n            \"if (timeout.id) clearTimeout(timeout.id);\",\n            \"timeout.id = setTimeout(function() {\",\n                \"timeout.id = 0;\",\n                \"resume('Timeout', msg)\",\n            \"},sm.data.timeoutTime);\"\n        ],\n        \"status\": {\n            \"fill\": \"green\",\n            \"shape\": \"dot\",\n            \"text\": {\n                \"get\": \"sm.currentState;\"\n            }\n        }\n    }\n}\n","x":418,"y":484,"wires":[["11226cb7.59f1c3"]]},{"id":"97602d44.5ed6b8","type":"link out","z":"a3c1f642.060128","name":"Data out","links":["7625d6fe.6f2a38","4209ac67.d5b354"],"x":535,"y":100,"wires":[]},{"id":"79a3fdb7.04e84c","type":"inject","z":"a3c1f642.060128","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"flush","payloadType":"str","x":300,"y":340,"wires":[["eaf46739.b3547"]]},{"id":"4209ac67.d5b354","type":"link in","z":"a3c1f642.060128","name":"Queue In","links":["97602d44.5ed6b8"],"x":415,"y":240,"wires":[["eaf46739.b3547"]]},{"id":"a2651a7a.07532","type":"debug","z":"a3c1f642.060128","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1030,"y":660,"wires":[]},{"id":"9154db85.b9ee28","type":"debug","z":"a3c1f642.060128","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1030,"y":700,"wires":[]},{"id":"2a839e08.f96802","type":"function","z":"a3c1f642.060128","name":"MQTT to InfluxDB","func":"//msg.url =\"http://localhost:8086/write?db=greenhouse\";  //Test later!!!!!!!!\nvar str = JSON.stringify(msg.payload);\n\n\nstr = str.replace(/[\\\"]+/g, '');\nstr = str.replace(/[\\:]+/g, '=');\n//str = str.replace(/[\\,]+/g, ' ');\n\nstr = str.slice(1,-1);\n\nvar d = new Date();\nvar n = d.getTime();\nvar timestamp = parseInt(n/1000);\n\nmsg.payload = msg.measurement + \" \" + str + \" \" + timestamp;\n\n//msg.payload = tokens[2] + \",device=\" + tokens[1] + \" value=\" + msg.payload;\nreturn {payload:(msg.payload)};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":230,"y":600,"wires":[["e65178e1.0c873"]]},{"id":"4c6830b1.0f31f8","type":"http request","z":"a3c1f642.060128","name":"POST logs","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://localhost:8086/write?db=logs&precision=s","tls":"","persist":false,"proxy":"","authType":"","x":630,"y":600,"wires":[["1598c86d.7c15a8"]]},{"id":"1598c86d.7c15a8","type":"debug","z":"a3c1f642.060128","name":"","active":true,"console":"false","complete":"true","x":790,"y":540,"wires":[]},{"id":"4058f086.d0ebf","type":"function","z":"a3c1f642.060128","name":"","func":"var d = new Date();\nvar n = d.getTime();\nmsg.timestamp = parseInt(n/1000);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":150,"y":80,"wires":[["21555e8f.2378d2","e3caed31.90d29","5e75a158.978e7","d6ed4b4.f57d9b8"]]},{"id":"7214e395.1f4b14","type":"inject","z":"a3c1f642.060128","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"trigger","payloadType":"str","x":210,"y":520,"wires":[["db826084.b376b8"]]},{"id":"e65178e1.0c873","type":"change","z":"a3c1f642.060128","name":"","rules":[{"t":"set","p":"headers","pt":"msg","to":"{\"Content-Type\":\"application/json\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":600,"wires":[["4c6830b1.0f31f8"]]}]

I had not realised which flow you had linked earlier, but there has been another discussion of a similar situation, but I can't find it at the moment. This is the flow we ended up with, which is rather simpler than the earlier one that you have used. I need to update that one.
image

[{"id":"f82aed15.9f1a98","type":"q-gate","z":"bdd7be38.d3b55","name":"q-gate","controlTopic":"control","defaultState":"queueing","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","peekCmd":"peek","dropCmd":"drop","statusCmd":"status","maxQueueLength":"100","keepNewest":false,"qToggle":false,"persist":false,"x":410,"y":1440,"wires":[["ae4b0558.378d8","b6aba10c.b691f"]]},{"id":"6ec96b3b.ec5c14","type":"debug","z":"bdd7be38.d3b55","name":"OK","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":2080,"wires":[]},{"id":"fed5956.ed73668","type":"inject","z":"bdd7be38.d3b55","name":"inject messages","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":1440,"wires":[["f82aed15.9f1a98"]]},{"id":"4ef6d24.5459eac","type":"inject","z":"bdd7be38.d3b55","name":"Retry","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"peek","payloadType":"str","x":90,"y":1620,"wires":[["a20949f9.306a48"]]},{"id":"4270c3f6.19012c","type":"delay","z":"bdd7be38.d3b55","name":"process","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":340,"y":1920,"wires":[["b0c78702.b01988"]]},{"id":"a8381ab7.d1949","type":"link out","z":"bdd7be38.d3b55","name":"","links":["5a2f45b9.929cc4"],"x":795,"y":2040,"wires":[]},{"id":"5a2f45b9.929cc4","type":"link in","z":"bdd7be38.d3b55","name":"","links":["a8381ab7.d1949"],"x":95,"y":1500,"wires":[["1ec5d8f7.0e6ae7"]]},{"id":"1ec5d8f7.0e6ae7","type":"function","z":"bdd7be38.d3b55","name":"get next","func":"node.send({topic: \"control\", payload: \"drop\"})\nmsg.topic = \"control\"\nmsg.payload = \"peek\"\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":1500,"wires":[["f82aed15.9f1a98"]]},{"id":"672111d5.4f229","type":"inject","z":"bdd7be38.d3b55","name":"Simulate internet up","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"internet","payload":"up","payloadType":"str","x":230,"y":1980,"wires":[["edb0af2.fd1645"]]},{"id":"bc5fa483.adc8f","type":"inject","z":"bdd7be38.d3b55","name":"Simulate internet down","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"internet","payload":"down","payloadType":"str","x":230,"y":2020,"wires":[["edb0af2.fd1645"]]},{"id":"edb0af2.fd1645","type":"join","z":"bdd7be38.d3b55","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":470,"y":2000,"wires":[["b7feed8e.7caf68"]]},{"id":"b0c78702.b01988","type":"change","z":"bdd7be38.d3b55","name":"topic:data","rules":[{"t":"set","p":"topic","pt":"msg","to":"data","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1920,"wires":[["edb0af2.fd1645"]]},{"id":"b7feed8e.7caf68","type":"switch","z":"bdd7be38.d3b55","name":"Data message?","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"data","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":380,"y":2080,"wires":[["d96e80be.41aff"]]},{"id":"d96e80be.41aff","type":"switch","z":"bdd7be38.d3b55","name":"OK/Fail?","property":"payload.internet","propertyType":"msg","rules":[{"t":"eq","v":"up","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":560,"y":2080,"wires":[["6ec96b3b.ec5c14","a8381ab7.d1949"],["ea9c5a96.2dcfe8","37735513.24d77a"]]},{"id":"ea9c5a96.2dcfe8","type":"debug","z":"bdd7be38.d3b55","name":"FAIL","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":2120,"wires":[]},{"id":"a20949f9.306a48","type":"gate","z":"bdd7be38.d3b55","name":"","controlTopic":"gate_control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":610,"y":1620,"wires":[["f82aed15.9f1a98"]]},{"id":"ae4b0558.378d8","type":"change","z":"bdd7be38.d3b55","name":"Close gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"gate_control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":1580,"wires":[["a20949f9.306a48"]]},{"id":"a78ce065.5c9b68","type":"change","z":"bdd7be38.d3b55","name":"Open gate","rules":[{"t":"set","p":"topic","pt":"msg","to":"gate_control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":1720,"wires":[["a20949f9.306a48"]]},{"id":"e5978b76.2fb2b","type":"link in","z":"bdd7be38.d3b55","name":"","links":["b6aba10c.b691f"],"x":135,"y":1920,"wires":[["4270c3f6.19012c"]]},{"id":"b6aba10c.b691f","type":"link out","z":"bdd7be38.d3b55","name":"","links":["e5978b76.2fb2b"],"x":615,"y":1440,"wires":[]},{"id":"37735513.24d77a","type":"link out","z":"bdd7be38.d3b55","name":"","links":["7f6b726d.0cab2c"],"x":795,"y":2160,"wires":[]},{"id":"7f6b726d.0cab2c","type":"link in","z":"bdd7be38.d3b55","name":"","links":["37735513.24d77a"],"x":55,"y":1720,"wires":[["a78ce065.5c9b68"]]},{"id":"5d647435.11ea14","type":"comment","z":"bdd7be38.d3b55","name":"Processed ok","info":"","x":690,"y":2020,"wires":[]},{"id":"cda552d1.59b25","type":"comment","z":"bdd7be38.d3b55","name":"Failed","info":"","x":670,"y":2160,"wires":[]},{"id":"6777d4.5738d02c","type":"comment","z":"bdd7be38.d3b55","name":"Replace this with your message processing, sending a message to the Fail or Success outputs","info":"","x":350,"y":1820,"wires":[]},{"id":"d1158219.184d38","type":"comment","z":"bdd7be38.d3b55","name":"Messages to be processed come in here","info":"","x":200,"y":1880,"wires":[]},{"id":"4681668e.9d5cd8","type":"comment","z":"bdd7be38.d3b55","name":"Feed messages to be queued in here and remove Inject node","info":"","x":270,"y":1400,"wires":[]},{"id":"177f73a0.c29e2c","type":"status","z":"bdd7be38.d3b55","name":"","scope":["f82aed15.9f1a98"],"x":80,"y":1660,"wires":[["b95b8054.e3339"]]},{"id":"b95b8054.e3339","type":"function","z":"bdd7be38.d3b55","name":"Queue empty?","func":"// expects msg.status.text in form \"queuing: <number>\"\n// sends a message if queue is empty\nif (parseInt(msg.status.text.split(\":\")[1]) !== 0) {\n    msg = null\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":1660,"wires":[["a78ce065.5c9b68"]]},{"id":"e72ba10d.c92638","type":"comment","z":"bdd7be38.d3b55","name":"Set this to appropriate retry interval","info":"","x":150,"y":1580,"wires":[]},{"id":"384aef3e.b12c2","type":"debug","z":"bdd7be38.d3b55","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":1740,"wires":[]}]
1 Like

Thank you again, I will have a look.

At the moment I 'was' updating the 'old' flow so that any connection to write to the Database is done through the one HTTP request rather than several accessing at their own times/periods. Performance of InfluxDB already seems more reliable!

Not looked yet, but I will have a look at the new flow and firstly, understand what makes it tick and then, if necessary see how I can modify that to a single flow for access.

There isn't any particular reason to move, if you have got it working, unless, like me, you don't like messy code lying about even if it works fine.

Presumably you are feeding everything through one queuing flow so they all get queued up sequentially.

I am/was an Engineer, my 'friend' the top flight Head Teacher says that I definitely have OCD as I keep needlessly tidying things up! So, you and me both!! :joy: :rofl: :joy:

I also like to see the different techniques used by more experienced people, no matter what I am working on so will probably change things anyways!!

That is the ultimate aim!! Getting there and learning along the way.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.