Consider a situation where mqtt server is down. And , with mqtt client you publish messages on to the topic, at this time it will throw connection refused exception. Later when the server is up , you can retry the connection and publish those messages which were failed to published due to the loss of connectivity. In such situation , what needs to be done in spring mqtt integration ? Also , if you can throw some light on spring4 mqtt support.
2 Answers
Instead use Spring Integration
and Spring JMS
, then use ActiveMQ or RabbitMQ
.
Using Spring JMS
client application will send data to Broker
, you just have to provide the Broker URL and coding configuration is also easy and understandable.
Your client application will publish the message and that will be received in Broker Application Suppose Active MQ now when your server application run then it will consume data from Broker
Application and further process it.
So one thing is that Always keep running / active your Broker, your server doesn't need to active.
ActiveMQ
is quite better if you don't have much Processing and don't want more facility.
It store data in queue, It's good I have used it.

- 7,858
- 6
- 43
- 62
-
Thanks for Reply !! But My requirement is using mqtt . As I am broadcasting the messages on multiple topics , where as in the case of ActiveMQ its point to point connection and uses queue for publishing. – Swagat Kolhe Jun 10 '14 at 11:36
-
No in ActiveMQ you can also publish, you just have to send the message to Broker, then whom so ever want to consume data, just tell application that from this Broker and from this queue get the data. – user3145373 ツ Jun 10 '14 at 13:17
I would suggest to just take a look at the different options of scaling out in ActiveMQ http://activemq.apache.org/how-do-distributed-queues-work.html
Also to consider Apache Camel routes http://activemq.apache.org/broker-camel-component.html

- 1,077
- 8
- 21