Alerting on mqtt failure

I’m using the mqtt binding to update many of my items and periodically the binding stops receiving updates from the broker; usually for no obvious reason, but once in a while because the broker was restarted or temporarily disconnected from the network. I’d like to set up a rule to trigger an email alert if there have been no MQTT messages for a period of time (i.e., 5 minutes)… I know how to set up an item to be updated if a specific topic receives an update, but in this case, i’d like to do the update if any topic is updated – i.e., /# (or any item configured with an MQTT binding)
I have a fallback, which would be to look at two or three of my most frequently updated items, but it feels cleaner in this specific case to trigger on lack of any messages. I’m currently running OH 1.8.1

I’ve discovered that I can listen for wildcard topics at the same time I listen for specific topics.
I’ve added the following items to ops.items -

String		ISY_any	"ISY message [%s]"   {mqtt="<[mqtt87:/isy/#:state:JS(isy_message.js)]"}
String		ENV_any "Env message [%s]"   {mqtt="<[mqtt87:/env/#:state:JS(isy_message.js)]"}
DateTime	MQTT_Update  "Last MQTT update [%1$ta %1$tR]"

(these two topics cover the majority of my MQTT messages, including several that should be posted once a minute)

and the following in ops.rules:

rule "ISY_any_rule"
when
	Item ISY_any received update
then
	postUpdate(MQTT_Update, new DateTimeType())
end

rule "ENV_any_rule"
when
	Item ENV_any received update
then
	postUpdate(MQTT_Update, new DateTimeType())
end

I now have the timestamp of the most recent MQTT message. The remaining task is to create a rule that will fire if there are no updates for more than 5 minutes.

Thanks, that’ll do the trick. I’ve implemented the rule; if it doesn’t fire on its own tonight, I’ll force a failure to test it tomorrow evening.