Recently, the use of wireless sensor networks has spread to applications areas that are not viable or costefficient to be run on other types of networks. Due to some critical tasks done in these types of networks, the majority of sensor networks applications should be dependable and should be run continuously and reliably without interruption. Hence, the two more significant dependability factors that should be nowadays taken into account in developing wireless sensor networks applications are ‘availability’ and ‘reliability’ of application services. The specific characteristics and constraints of wireless sensor networks require a different interpretation of these two factors when developing applications for such networks. In this paper, we propose a middleware layer mechanism for satisfying these two factors as more important dependability issues in sensor networks applications. We propose an event-based middleware service that is specifically designed for wireless sensor networks in which a group of sensor nodes forms a cluster and a replicated service is run on each cluster head. The communication model among cluster members and cluster head is based on the publish/subscribe scheme. We show how the replicated services and communication model in cluster nodes satisfy dependability issues and increase the availability and reliability of applications running under the proposed middleware.