1

I wanted to make use of Shared Subscription feature of MQTT v5. But currently I am using AKKA MQTT client which doesn't support MQTT v5 client. Can I still use v3 MQTT paho client and use Shared Subscription feature?

saumilsdk
  • 721
  • 1
  • 7
  • 17
  • In theory - yes. In practice - try it out. – oakad Mar 24 '21 at 05:42
  • Can you please elaborate how theoretically it should work? – saumilsdk Mar 25 '21 at 06:07
  • 1
    Any sane broker will check the version field in your "connect" packet. Nobody expects people to upgrade all the clients when broker is updated. :-) – oakad Mar 25 '21 at 06:34
  • 1
    One of the objective we have set for our MQTT5 development is that both the versions should work on the same instance of the broker, so that the customer will be able to seamlessly use both the clients during their migration. – Ranjith Kumar Diraviyam May 21 '21 at 03:20

2 Answers2

2

That should not be a problem as from the viewpoint of an MQTT v3 client a shared subscription is just like any subscription.

The broker has to do all the work regarding shared subscription logic.

The only hindrances I can see are:

  • that an MQTT broker might support v5 but not v3/v3.1.1
  • the broker doesn't support shared subscriptions in general (yes they exist)
  • the broker supports all MQTT versions but handles them as two different protocols (not sure if this is a thing)
MicWal
  • 141
  • 5
0

Using paho client write an app(ensure that this will use MQTT v5) that will have two clients.

Client_v3 will subscribe to the topics from the source i.e. from the app that sends MQTT v3

Client_v5 will publish the received topics as it is received in the above step.

In your application where you want to use shared subscription(again ensure it uses MQTT v5) alter the topics $share/<topic> and make it to get the topics from the client_v5 publish

In simple word: make you paho client code to act as a broker between v3 and v5 apps.

vikash vishnu
  • 337
  • 1
  • 4
  • 11