create Dynamic web project in sts/eclipse
download the eclipse paho jar from click here to download and paste jar file in webcontent->webinf->folder->lib
Publish Example
String broker = "tcp://localhost:1883";
String topicName = "test/topic";
int qos = 1;
Mqt...