Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] One client and a delegating callback OR multiple clients/callbacks?

Hi!

Since the relationship between a client and a callback implementation is 1 to 1 then what's the recommended design in my situations when I will be pushing out a bunch of different messages to (Android) clients and collect various responses? ONE client for the whole backend with a callback that delegate each arrived message on to the appropriate consumer (based on the name of the topic) or MULTIPLE clients/callbacks where I have one for each known "message type"?

The code would look a lot a nicer with one callback per subscription instead of some "Java 7-string-switch", but that means that I would have around 5-10 client connections... Is it "expensive" to have multiple client connections to say Mosquitto?

Br
Andreas

Back to the top