I am just getting started with MQTT. I have an embedded system which I am going to add an MQTT Client to, and then I will start working with the MQTT Broker.
I would like to describe the project I am working on, to hopefully get some feedback on the direction of the MQTT set up.
I apologize in advance. I am in the state of not knowing what I don’t know, so I may well be talking MQTT nonsense in the following.
We would have a few thousand kiosks in the field
A user can buy a voucher online / in a store, enter the voucher number at the kiosk, and use a service that one time. The number of use-once vouchers would be in the hundreds of thousands. Each voucher would have a unique(say) 16-digit number.
When the voucher number is entered, the kiosk needs to verify (with a remote server) that the voucher number is valid, then provide a service to the user, then notify the remote server of the final voucher status (e.g. “used”).
When receiving the voucher verification request, and the voucher final status, the remote server would also want to know the kiosk ID, location, time/date and some other data.
I am trying to figure out how the topics and messaging would be structured.
One way might be for each kiosk to create and publish a topic about itself (id, location etc.), and the remote server to subscribe to all kiosk topics. When a user enters a voucher, the kiosk could create and publish another topic about the voucher – e.g. my_project/kiosk_num/voucher_num?
But I was wondering if each voucher number could be a topic. Each kiosk could create a topic about itself, so that the remote server knows the status of the kiosks. But a kiosk could also create and publish a new voucher topic (e.g. my_project/voucher_num), when a new voucher number is entered. The remote server would subscribe to all (possible) voucher topics.
Thanks for reading this. Any feedback / pointers would be greatly appreciated.