From what I could analyze, you've been trying to read data from the broker directly, but that's not how it works exactly. With the MQTT broker, you will just have to subscribe to a topic and receive data everytime a new message gets published to it.
Try setting the connection on an instance of the MqttCallback interface:
client.setCallback(new MqttCallback() {
public void connectionLost(Throwable cause) {
}
public void messageArrived(String topic,
MqttMessage message)
throws Exception {
System.out.println(message.toString());
}
public void deliveryComplete(IMqttDeliveryToken token) {
}
});
Although, you don't need to create the desired topic, just tell the broker the topics you are interested in, like this:
client.subscribe("topic/foo")