Skip To Content
The Mayor of London The London Assembly

Creating an IoT Data Platform from Open Source Components

CONFIGURING DOCKERIZED WSO2 API MANAGER v3.0 PRODUCT ON UBUNTU 18.0 SERVER AS THE PART OF URBAN SHARING PLATFORM

New sensors and Internet of Things (IoT) devices are springing up across cities. They provide a great opportunity for more detailed and up to date information for city planners and service deliverers on range of topics from air quality to community safety.

However, they also come with a number of challenges including:

  • Dealing with the scale of data
  • Many IoT networks have their own proprietary APIs
    and data formats
  • Managing security and access

Funded through Sharing Cities and in collaboration with the Royal Borough of Greenwich, I’ve been building on work pioneered on the Queen Elizabeth Olympic Park to create a complete solution from open source and readily available components. The components are connected using open standards, meaning that they can be upgraded or swapped out in the future. This creates a more flexible and resilient system than building a single monolithic platform. The full stack is shown here:

One of the most complex tasks was to implement WSO2 which I chose to do with Docker. As the other components are well described elsewhere, this blog is focussed on WSO2 / Docker

One of the main objectives of Urban sharing platform (USP) is to provide an interoperable platform used for managing and sharing data from a wide range of sources, including sensors. Data should be shared with different stakeholders from both the private and public sector using APIs and open standards. In order to securely share data between different parties using APIs, WSO2 provides an open source API management solution that might be used in USP for identity and access management (IAM) and API management.

Firstly, this article will give you information about WSO2 API Manager and its components. Once you are introduced to WSO2 API manager platform, the definition of docker and docker-compose will be in place. All this knowledge is necessary to understand how to install and configure WSO2 APIM docker containers on AWS Ubuntu 18.04 LTS server.

WSO2 API Manager

API management is the process of designing, publishing, documenting, and analyzing APIs in a secure environment. Through an API management solution, an organization can guarantee that both the public and internal APIs they create are consumable and secure.

The WSO2 API Manager is an open source API Management solution designed to manage APIs. It helps to create, publish, store, govern, secure and manage the life-cycle of APIs. It is licensed under the Apache Software License Version 2.0 which makes it free to use.

WSO2 API Manager comes with a modularized architecture so that users can scale the components based on their needs. WSO2 APIM consists of 6 main components listed below. All of these components are implemented in Java using WSO2 Carbon framework.

  • API Publisher – enables API providers to easily publish their APIs, share documentation, provision API keys, and gather feedback on an API’s features, quality and usage, 
  • API Developer portal: provides a space for consumers to discover API functionality, subscribe to APIs, evaluate them and interact with API publishers, 
  • API Gateway: enables you to secure, protect, manage, and scale API calls, 
  • Traffic Manager: The Traffic Manager helps users to regulate API traffic, make APIs and applications available to consumers at different service levels, and secure APIs against security attacks. The Traffic Manager features a dynamic throttling engine to process throttling policies in real-time, including rate limiting of API requests, 
  • Key Manager: Manages all clients, security and access token-related operations, 
  • Analytics: Additionally, monitoring and analytics are provided by the analytics component, WSO2 API Manager Analytics. This component provides a host of statistical graphs, an alerting mechanism on predetermined events and a log analyzer. For more information. 

The interconnections of these components happen through databases. The default database used for WSO2 API Manager is H2. However, there are also other databases that can be used for data storage such as MySQL, Postgres, DB2, Oracle, or MS SQL.

Docker

Docker is the most popular containerization engine that developers use, largely due to its high-performance and widespread compatibility with other technologies. It is a tool designed to make it easier to create, deploy and run applications by using containers. Containers allow a developer to package up an application with all its libraries and other dependencies into one package. This way, the containerized application can run on any machine regardless of different settings from the machine used for writing and testing of application.

In a way, Docker is a bit like a virtual machine. But unlike a virtual machine, rather than creating a whole virtual operating system, Docker allows applications to use the same operating system as the system that they’re running on and only requires applications be shipped with things not already running on the host computer. This gives a significant performance boost and reduces the size of the application.

Installation and configuration of docker-compose files for WSO2 APIM

WSO2 API Manager and its components are dockerized. You can access its docker and docker-compose files from github. Docker-compose files have been created according to the most common API management deployment patterns.

The installation and configuration we are going to follow is for a “WSO2 API Manager with identity server as key manager and API Manager Analytics solution”. The compose files for the aforementioned solution make use of WSO2 docker images listed below:

  • WSO2 Analytics Dashboard
  • WSO2 AM (API manager)
  • WSO2 IS-KM (Identity Server as Key Manager)
  • WSO2 Analytics Worker
  • MySQL database

Click the link below to see the instructions on how to install and configure dockerized WSO2 API manager v3.0. 

References:

  1. WSO2 self-paced training: https://lms.wso2.com/courses/take/wso2-api-manager-3-0-developer-fundamentals/pdfs/10538611-architecture 
  2. https://apim.docs.wso2.com/en/latest/
  3. https://medium.com/@chinthakaBlogs/introduction-to-docker-aws-ecs-wso2-apim-and-wso2-ei-42cffb2f1221
  4. https://opensource.com/resources/what-docker