I have an application wherein data is fetched from the SQL DB and sent to the service bus as brokered message. These are the steps:
- Data fetched from the DB(in batches of 1000)
- Each row of data converted into Brokered Message and added into a list.
- The list of 1000 brokered messages is sent to the service bus using SendBatchAsync method.
It is at the 3rd step that I am facing the issue. This is the code for that:
public async Task SendMessagesAsync(List<BrokeredMessage> brokeredMessageList)
{
try
{
var topicClient = CreateTopicClient();
await topicClient.SendBatchAsync(brokeredMessageList);
}
catch(Exception ex)
{
throw ex;
}
}
when the compiler comes to SendBatchAsync method, it gives an error that Error during communication with Service Bus. Check the connection information, then retry. with the inner exception being:
Internal Server Error: The server did not provide a meaningful reply; this might be caused by a premature session shutdown. TrackingId:some guid here
However if I try sending 100 messages, it works fine. What can I do to make it send 1000 messages at a time?
Note: each message size is 1445 bytes