How to send objects instead of string in mqtt messages?
问题 I'm currently using mqtt to communicate between client and server and mqtt publish method takes message as bytes. I need to send latitude, longitude, address,etc in my single mqtt publish and be able to receive those on server side. How can I achieve it? I'm using wmqtt client library on client side (android) and paho client library on server side (jsp,servlets). deviceloc d=new deviceloc(); d.id="1234"; d.add="hyder"; d.lat=17.5; d.lon=78.5; try { ByteArrayOutputStream b = new