To satisfy the stringent QoS requirements of distributed real-time embedded (DRE) systems, middleware services customized to the specific needs of the application may be needed. This problem is often attacked by re-implementing all or large portions of an existing middleware service, which can be a time-consuming and an error prone task. In this paper, we propose a model-driven approach for middleware customization. To enable this approach, we propose Event Communication Framework (ECF), a customizable middleware framework which provides a number of different options for implementing various features of event communication. To determine when to exercise each option, we have performed experiments to identify the application contexts in which each ECF mechanism performs better than the others. Heuristics from these experiments have been incorporated into algorithms which analyze high-level specifications of application scenarios to identify where ECF customizations can be applied. We provide configuration tools that generate customized push paths for event notifications using a combination of code synthesis, weaving and transformation techniques. We have applied our approach to the application scenarios in the Boeing BoldStroke system.