In order to demonstrate the power of combining traditional API management concepts and technologies with the increasing need for event-driven data distribution and interaction, we jointly deployed Apigee (Google) and Solace. We made sure to demonstrate functionality in areas such as governance, access control, security, auditing, and metering.
We have used a connected elevator scenario to demonstrate our solution. Our goal was to retain the user-facing experience of API management and only add minimal interactions to the process so API users and developers can find themselves equally at home with RESTful APIs as well as event-enabled APIs.
Disclaimer: The solution described here is not an officially supported Google or Solace product.
A solid foundation for enabling an IoT ecosystem can dramatically extend and increase the value of connected assets – like cars, elevators, and equipment. Building on mature technologies using proven techniques makes implementation faster, less expensive and less risky.
The following ‘value curve’ shows how the value of IoT platforms increases dramatically with maturity stages, from reactive, interactive, predictive & proactive, and federated. The green dots represent the technological capabilities that are required at each stage, while the list represents the business-level goals that a company aims to achieve.
As you can see, the more we go to a federated model the higher the value and business benefits we get out of our IoT data.
We have already introduced a real-time, event-driven backbone by moving through the previous stages of maturity shown in the diagram, but opening up internal data streams and analytics outcomes for external consumption requires additional capabilities.
We aim to achieve this through traditional API management, which can securely manage access to data streams and events (often governed by contractual agreements), with the ability to audit and meter usage to enable commercial models.
If we want to enable third parties and users to interact with our platform or assets, security and access control mechanisms become even more challenging.
Let’s take a closer look at a use case that would benefit from event-enabling APIs.
Connecting building infrastructure and assets unlocks the potential for remote monitoring and analytics; thus paving the way for proactive and preventative maintenance. Connected elevators are able to send both operational and diagnostics data.
|Operational Data||Diagnostics Data|
This kind of information could be valuable to a number of different parties – large hotel chains, on-site staff, maintenance companies, elevator companies, insurance companies, or even advertising companies. It could also be useful to be able to send commands to control elevators remotely, such opening doors, stopping the elevator, or sending it to a certain floor.
So, in the case of connected elevators, there is a need for internal business units, partners, or customers/users to:
However, there is only limited value in sharing the raw data streams. Therefore, we will introduce the concept of data products – the transformation of raw data streams to value-added, actionable insight streams and events to federate via APIs.
Combining Apigee and Solace can solve the needs discussed above in a scalable, automated, and secure way. We’ll now describe some of the highlights of the solution we have developed using the following scenario:
The following picture shows the architecture at run-time:
The elevators are connected through an event mesh based on PubSub+ Event Brokers. This makes the raw telemetry data available at the core and enables the sending of control and command messages. Based on the raw data, ElevatorCo can now create data products for specific use cases and/or customers.
Apigee makes it possible to expose these data products as APIs so external consumers (ServiceCo) can subscribe to events from the provider (ElevatorCo) via its API Proxy. The analytics component gives the provider insights into the usage of the various APIs.
On the consumer side, ServiceCo provides either the REST endpoints for events and data to be pushed to and/or the MQTT clients connecting to the data product Edge. In this project, we have implemented an Azure function that is triggered every time an event arrives; it then introspects the event and forwards it to a specific user / slack channel. Other applications such as a Workforce Management SaaS or other dashboards could receive the same events.
Apigee handles the data flow outside of the provider’s system, collecting usage metrics and providing a developer portal that lets consumers see what data available is and register for the service.
The following picture shows the provisioning flow:
The provisioning is divided into two parts:
Now, let’s take a closer look at the flow when an individual developer requests an API. The developer signs up for an API, providing the REST endpoint of their ‘notification service’. This request is managed within the API Portal, which generates an API key and triggers the ‘provisioning API’. The provisioning API automatically configures the Solace broker(s) with the correct access profile/lists, the internal queues, subscriptions, and various other settings. These settings ensure the secure delivery of the selected data product streams via the broker and the proxy to the developer’s notification REST endpoint.
As a first step, ElevatorCo developers need to create data products to share via the API.
The main concept of a data product is based on the notion that typically the raw event and data streams from the connected assets are not necessarily something the company would like to expose. Instead, data product microservices ingest the stream of raw telemetry and event data from the assets and create what we call ‘actionable insight’ from these.
The following picture shows two examples:
In order to facilitate the creation, distribution, and publishing of data products, we have designed a hierarchical topic namespace which includes the semantics required to describe a data product as well as providing for flexible routing and distribution.
The raw telemetry data from the assets (elevators) contains the detailed categorization, including the resource type (which elevator type) and the resource ID (which elevator). The data product then adds specific business level information, for example:
We now use this information to create a topic string template that all data products will follow, for example:
Following this template, and assuming that elevators are installed in the Marriott Marquis in NYC and all Hilton properties in France, the data product alarms would publish on:
And so on …
Whereas the data product for predictive maintenance publishes on:
Using this topic template or pattern, we can now define very specific data products streams for ServiceCo, for example:
In the next section we will see how these topic strings (i.e. very specific data streams) are used when defining the specific API for a specific customer (ServiceCo).
As discussed above, the data products are defined by their topic strings and distributed to customers via wildcard subscriptions. The following screenshot shows how a product manager in ElevatorCo uses the portal to define and publish a data product.
Let’s assume the developer has already created their ‘notification service’, i.e. the Azure function with its REST endpoint and the integration to Slack.
They then create an account on ElevatorCo’s Apigee developer portal and wait for approval. After being approved, they subscribe to their allowed API products and provide a base URL + REST endpoint to send the notifications to.
Behind the scenes, this API calls the provisioning API that sets up the client username, queue, subscriptions, and REST delivery point in the Solace broker(s) amongst others.
For any event sent by the data product, the PubSub+ Event Broker sends this data through the API Proxy to the consumer’s notification service that they defined in the provisioning step. This way the consumer can receive the data wherever they need them in real time through a REST interface (webhook). The following picture shows this integration with Slack, where a critical alarm is sent/routed to the correct channel – in this case, the duty manager in the Hilton Opera, Paris, France.
The provider (ElevatorCo) can see all the data that went through the proxy and can create reports. For example, the usage report will tell them what each consumer has subscribed to and on which API product, including the number of received alerts.
In addition, Apigee also allows the provider to create custom reports that would offer insights on the type of alerts, time, or any other dimension in the data product.
We hope that with this article we have shown and explained the concept of event-enabling APIs and how a combination of the real-time, highly scalable event mesh and PubSub+ Event Broker architecture and Apigee’s API Management Platform can power these concepts.
The approach we have taken here was guided by the notion that we wanted to create a seamless experience, based entirely on the well understood and accepted RESTful API experience, without introducing additional risk and cost. We have created a working solution based on a realistic use case. Of course, there are many other combinations and use cases out there. We are confident that using the flexibility of both platforms can address these as well.
For a more detailed view of the solution please look at the recording that walks the audience through the exact steps: