In this post I’m going to write a bit about Oslo.Messaging – a Python library that provides a simple abstraction for Remote Procedure Call and Notification messaging services.
Oslo.Messaging (which, for the sake of brevity, I’ll refer to as “OM”) is part of the OpenStack Oslo project – a collection of common utilities shared among the various services that comprise the OpenStack cloud computing platform. While technically part of the OpenStack project, OM has been developed as a stand alone component that can be integrated into any Python application that needs messaging support – not just OpenStack and friends.
Cloud computing is an example of distributed processing. Virtualized compute, storage, networking and other services can be deployed across multiple physical systems, possibly spread across several data centers.
Messaging services – which allows separate processing domains exchange information – play a key role in distributed systems. Each component of the system needs a mechanism for communicating with its peers, whether those peers are co-located on the same physical machine or scattered across the globe. These systems simply cannot function without a messaging solution that can knit together the separate parts into a functioning whole. OpenStack uses OM for exactly that.
OM is used by an OpenStack service for its internal messaging needs. That is, OM is used within a service (Nova, for example) for communicating between the separate processes that make up that service. OM is not used for communications between the different OpenStack services (e.g. between Nova and Keystone). Inter-service communication is done using the service’s public API, which provides a RESTful HTTP interface. RESTful interfaces are the norm for web-based services like OpenStack. But for internal inter-process communications, OpenStack eschews the overhead and limited flexibility of HTTP for a dedicated message oriented solution.
So, exactly what can be done with OM?
OM provides two message service API’s, Remote Procedure Call and Notifications. Programmers are likely to be familiar with Remote Procedure Call (or ‘RPC’) services. RPC is a type of inter-process communication that is modeled like a function call in a programming language, except that the process making the call is separate from the process that executes the ‘function’. OM provides APIs for defining, issuing and processing RPC requests.
Notification is an event generation/consumption service. A process generates events which are queued up for eventual consumption by an event processing service. This is roughly analogous to a logging/monitoring process: an application fires off log messages which are written to storage (file, db, whatever); at some later date those log messages can be post-processed by a different application. OM provides APIs for generating and consuming notifications.
And that’s my very brief introduction to Oslo.Messaging. In my next post I plan to delve into all the gory details of OM’s RPC API. Stay tuned…