This study presents a design of a distributed architecture and an application for automated demand response, in which one electricity aggregator cooperates with a group of consumers. The distributed architecture utilizes an asynchronous message oriented middleware to integrate the defined components. The application adopts a distributed demand response optimization algorithm for the validation of the presented architecture. The algorithm aims to optimize the charging schedule of the consumers' energy storage devices in order to minimize the energy acquisition cost while maintaining a level of elasticity in the schedules. By means of simulations, it is validated that the distributed architecture is capable of performing optimized automated demand response.