You are tasked with developing a stream processing solution for a smart grid system that monitors and manages energy consumption in real-time. The system needs to detect and respond to anomalies in energy usage patterns. How would you design the solution to achieve this?