private String getPublishedMessage(String configString, String message) throws BindingConfigParseException {
final List<String> sentMessage = new ArrayList<String>();
MqttMessagePublisher publisher = new MqttMessagePublisher(configString);
publisher.setSenderChannel(new MqttSenderChannel() {
@Override
public void publish(String topic, byte[] message) {
sentMessage.add(new String(message));
}
});