Welcome to the forum!
Just from a quick scan of your code I don’t see the Producer managing demand.
I recommend reviewing this topic: