Working Code here
static MessageSender TopicClient;
public static void SendTopicMessage(BrokeredMessage message)
{
IAsyncResult result = TopicClient.BeginSend(message, processEndSend, TopicClient);
Thread.Sleep(5000);
}
public static void processEndSend(IAsyncResult result)
{
MessageSender messageSender = result.AsyncState as MessageSender;
messageSender.EndSend(result);
}
The above code is working. But I don’t know why should I put Thread.Sleep(). I dont want to keep Thread.Sleep(). But It’s not working I remove that Thread.Sleep(). Any Suggestion?
I think you are calling the SendTopicMessage from a thread…
So if you remove Sleep() here your thread Terminated once its sent your first message…If you put Sleep(5000), you are sending next messages with in the 5 sec time duration so the thread kept alive.
I think You are designing Bad Architecture. Correct me If i am wrong.
For Clear understanding of your flow… Please post enough code snippets…