0
votes

I'm trying to send 1 Million small messages via an Event Hub with 10 partitions and 10 Throughput Units.

For that purpose I'm using javax.jms.MessageProducer .

My question is: How come I never get to catch a ServerBusy (or any other) exception although I do see errors on the Azure Event Hubs UI? Could it be that the java library already handles the exceptions, including maybe re-sending the messages, without exposing it outside at all?

And, generally speaking, what would be the Best Practice of ServerBusy Error Handling in a Java producer? (Maybe implement a rate-limiter so that the producer will always send not more than 1000 messages per TU? Or maybe implement a Resend Policy upon catching ServerBusy exception? ... )

2

2 Answers

0
votes

Both options have pros and cons. 1) When you use rate limiting, then only 1000 messages would be processed until the given time and so requests would be piled up if there are more requests per defined time but will promise that no one can have brute force attack to send messages.

2) Resend policy has has the benefit that if send method is failed it will try to resend. When using resend policy make sure you mention number of attempts for resend otherwise if server is down it will keep on resending the same and it would never stop.

0
votes

Per my experience,I think the issue about Server Busy Errors is the internal error of Event Hubs service that not be caused by Java Client, and not return any error signal or message to cause the related exceptions in Java Client.

Besides, please refer to the document Quotas and Limits(https://azure.microsoft.com/en-us/documentation/articles/service-bus-quotas/) and check the number of messages or other things whether beyond these quotas & limits.