Вопрос

So, I have a bunch of mobile devices (millions) and will have a backend system. My needs/use case are:- 1. To collect data from the devices and send to backend. 2. To send Push messages from my backend system to individual or groups of devices.

So, given this scenario, does it make sense to use MQTT for communication between my backend and the devices? One of the confusions, that I have is that in use case #1, devices are publishers and some system in backend will be subscribers, whereas for use case #2, devices are subscribers for the push messages and a backend system will be the publisher. Is this possible? Or am I thinking about it the wrong way?

Это было полезно?

Решение

Having worked on a number of examples (e.g. a mobile telemetry system with push notification) that fit this usage pattern I can say that MQTT can fit perfectly. Any MQTT client can act as both a publisher and a consumer, there is no distinction.

You will just need to design your topic structure to suit the data you are sending in either direction, but that should not be difficult.

Другие советы

In general, MQTT is a perfect fit for your use case #1 and use case #2.

Please keep in mind that you will probably get problems at this scale with backend subscribers because there are (as far as I know) no MQTT libraries around which can handle such a massive throughput.

A slightly different approach would be that the broker communicates directly with the backend, analogous to this blog post

Here is an interesting discussion on the MQTT mailing list on this topic.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top