The Internet-of-Things (IoT) envisages a future in which digital and physical things or objects (e.g., smartphones, TVs, cars) can be connected by means of suitable information and communication technologies, to enable a range of applications and services. The IoT's characteristics, including an ultra largescale network of things, device and network level heterogeneity, and the large number of events generated spontaneously by these things, will make development of the diverse applications and services a very challenging task. In general, middleware can ease the development process by integrating heterogeneous computing and communications devices, and supporting interoperability within the diverse applications and services. Recently, there have been a number of proposals for IoT middleware. These proposals mostly addressed Wireless Sensor Networks (WSNs), a key component of IoT, but do not consider Radio-Frequency IDentification (RFID), Machine to Machine (M2M) communications, and Supervisory Control and Data Acquisition (SCADA), other three core elements in the IoT vision. Taking a holistic view, in this article, we outline a set of requirements for IoT middleware, and present a comprehensive review of the existing middleware solutions against those requirements. In addition, open research issues, challenges and future research directions are highlighted.