azure - Sending 1000 brokered messages to the service bus using the SendBatchAsync method -
i have application wherein data fetched sql db , sent service bus brokered message. these steps:
- data fetched db(in batches of 1000)
- each row of data converted brokered message , added list.
- the list of 1000 brokered messages sent service bus using sendbatchasync method.
it @ 3rd step facing issue. code that:
public async task sendmessagesasync(list<brokeredmessage> brokeredmessagelist) { try { var topicclient = createtopicclient(); await topicclient.sendbatchasync(brokeredmessagelist); } catch(exception ex) { throw ex; } }
when compiler comes sendbatchasync method, gives error error during communication service bus. check connection information, retry. inner exception being:
internal server error: server did not provide meaningful reply; might caused premature session shutdown. trackingid:some guid here
however if try sending 100 messages, works fine. can make send 1000 messages @ time?
note: each message size 1445 bytes
unfortunately can't because total payload size 1.4 mb (1445 bytes * 1000) whereas maximum size of batch allowed 256 kb.
ref: https://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.topicclient.sendbatch.aspx (remarks section)
the maximum size of batch same maximum size of single message (currently 256 kb).
i guess need split batch further smaller batches don't exceed 256k limit.
Comments
Post a Comment