Better refactoring of the project and added throttling on both the publisher and the consumer for testing purposes.