Sandra,
(to me) the scenario is not so clear... correct me if I'm wrong.
- one MQTT broker
- all devices will publish to that broker
- two (or more) HTTP servers
- both servers subscribe to all topics on the (same) broker
- the HTTP servers are there in order to give redundancy / load balancing
The short answer is that MQTT by itself (as a protocol) has no
provisioning for rules like "if more than one client subscribed to this
topic, then send the related messages only to (the first?) one".
It may be possible that one of the existing implementations of a broker
has this, not to my knowledge.
You could play with $SYS statistics (on Mosquitto) and try to understand
of the HTTP server is connected as a client to the broker etc etc or
better, to stay on the safe side and not be linked to one particular
implementation, each server should specify a "last will" message when
subscribing to topics on the broker and a very simple watchdog demon
(ruby, python, anything) should react to the relevant message saying
"server #1 has disconnected!" with a logic, ex. start republishing the
messages that went to server #1 so that they will be processed by server
#2 now.
Something useful can also be obtained by playing with more brokers and a
bridge rule between them.
--
Stefano Costa, R&D Manager
M
+39 335 6565749
Skype stefanocosta.bluewind
Twitter @stefanobluewind
http://www.bluewind.it