Made producer more resilient to connection failure and added tests to help prove it