Spark.publish vs. http post

If you are considering webhooks, there seems to be some issues with using a publish/subscribe approach as dealt with in this post. Publish doesn’t seem to always return. It is an issue seen on many servers so it appears that the problem is Particle-side.

The benefits are great because you are more succinctly parsing your results… so there is the benefit if that gets ‘fixed’ in future updates.

Right now, I am not using publish/subscribe for projects that are more time-critical. For example, I’m getting my present email count from gmail… I just want it to be near-to real time so I poll the server every 30 seconds for an update. If I use publish/subscribe, it irks me that it is not returning reliably enough to keep my device current. Accomplishing this with an http request returns reliably nearly 100% of the time, in my observations. The downside is that the Spark Core that is using this is constantly flooded with data using the return from gMail’s Atom feed. If I was doing much more with the device, I may have concerns about that.

On the other hand, I am using weather underground for a device that uses sunrise and sunset. Using publish on that webhook once an hour. That seems to be reliable enough that I capture the times at least once in 24 daily tries!