This paper explores advantages that a publish/subscribe middleware can offer for the implementation of an efficient and reliable electric vehicle (EV) charging control infrastructure. We propose distributed optimization publish and subscribe (DOPS), a framework for distributed optimization of EV charging, which works on top of a pub/sub middleware and extends it to support in-network aggregation. For our evaluation, we deployed DOPS in a testbed consisting of 15 virtual machines connected via a VLAN network and compared three different communication schemes: centralized, decentralized and decentralized with aggregation. Our results show that for up to 120 EVs a centralized approach is faster. However, the trends reveal that for more than 150 EVs a decentralized approaches will offer better performance. Moreover, we demonstrate that the in-network aggregation feature of DOPS doubles the performance of the decentralized approach. Our results thus confirm that distributed control infrastructures can benefit from using pub/sub middleware.