Internet Of Things - publishing messages and inserting the data into database