Made changes to not publish messages if creation of topic clients failed

#2542 #2541