I had a similar situation with .NET code. There was a mismatch on the order data received and the way it is parsed in the code. It was breaking the loop. Debug and check for such condition in the code