Integration middleware provider WSO2 has announced a new Microservices Framework for Java (MS4J) to help developers build microservices in Java that support container-based deployments.
The emergence of cloud, mobile and the Internet of things (IoT) applications has accelerated the adoption of microservices, and WS02 is getting in on the action by delivering its own microservices framework for Java, said Isabelle Mauny, vice president of product management.
Microservices is a software architecture style where complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs. These decoupled services are small building blocks that focus on small tasks to facilitate a modular approach to system-building. To facilitate the creation of microservices based on Java, WSO2 today introduced its open-source WSO2 Microservices Framework for Java 1.0 (WSO2 MS4J).
“This product was born to give our customers a very lightweight framework for developing microservices in Java,” Mauny told eWEEK. “The key goal here is if you look at what a microservices architecture mandates, it will include an application with a set of the right services with the right scope, and each of those services will execute individually in its own little world, which is probably a container. That’s the trend and one of the most advocated patterns for deploying and managing microservices.”
Mauny noted that software architects and developers are adopting microservices to ensure continuous agile delivery and flexible deployment of their service-oriented applications across a range of platforms.
WSO2 is known for its expertise in delivering integration solutions, based on the company’s integration platform. The company provides enterprise service bus (ESB) integration, API management, and products for managing the security of integration and analytics of the integration platform.
“We have an entire platform offering our customers end-to-end solutions to integration problems,” Mauny said. “We look at integration as a large concept where you integrate data, security and services. And we apply analytics on each of those to understand at a technical level and at a business level the behavior of your system.”
In its analytics framework, WSO2 applies complex event processing, real-time analytics and machine learning to provide more real-time reaction to patterns in the execution of an application or services, as well as machine learning for learning from the past and predicting what could happen next. All of this is related to the MS4J framework and how it plugs into the overall WSO2 architecture, Mauny said.
The WSO2 MS4J framework enables organizations to build, integrate, manage, secure and analyze their APIs, applications, Web services and microservices—on-premises, in the cloud, on mobile devices and across the IoT.
The framework is built for high-performance, low-footprint architectures. Microservices developed using the framework can boot within 400 milliseconds in a Docker container and can easily be added to a Docker image definition, Mauny said.
“If you’re going to write a microservice in Java and run it inside a container, the whole advantage of running inside a container is it’s very lean, it’s very fast to deploy,” Mauny told eWEEK. “You can create a new container so you can very easily create a new instance of a service when you need it—because you have multiple applications that are tapping into that single service and you just need to boot up another instance to cope with that load. So when you boot up that new instance, it’s really important that that happens fast. If you have a container that can boot in a few hundred milliseconds, but it takes a minute to start the service behind it because the whole server in which the service is running is taking all that time to start, that kind of defeats the purpose.”
WSO2 MSF4J uses annotations, such as Java API for RESTful Web Services (JAX-RS) annotations, not only to write but also to monitor microservices. The framework uses metrics based on the WSO2 Data Analytics Server (WSO2 DAS) to monitor microservices.
WSO2 Launches New Microservices Framework for Java
“As a developer using standard annotation-type programming style, JAX-RS style, it’s very easy for someone to develop a microservice following a REST type style,” Mauny said. “And once that service is developed, it will be very easy for a DevOps person to take that service, place it inside a Docker image and have that service be booted in a few milliseconds as well. Our goal was that booting the container and the service would never take more than a second. So you have an instant feeling that that service is up, with your microservice ready to do something.”
On top of creating the programming model and making things as simple as possible for Java developers to use the framework, WSO2 also wanted to ensure that monitoring the behavior of the microservices built with the framework would also be very easy. That includes also annotating the microservice so that at execution time, developers will have some metrics on how long that resource takes to execute, how many times it has been called, by whom and more, Mauny said.
“We want to make that as easy as possible for the developer because experience proves that adding monitoring after the fact is difficult to do,” Mauny said. “It’s like adding logging after the fact—if you don’t do it as you write the code, then it’s very hard to go back through the code and start implementing it.”
Those metrics can either be written in a simple console in text form, or users can plug in their own analytics engine. “If you want to plug in our engine, it’s very easy to do,” Mauny said. “You just have to flip an option and then all this data will go into an analytics server. That’s at the DevOps level. Or you can configure it to go to your own engine that you already have deployed in your own infrastructure.”
WSO2 provides security token validation through pre-integration for WSO2 Identity Server and support for third-party authentication servers. The company also sought to simplify the process validating security tokens.
“We see this a lot in our experience with API management,” Mauny said. “When you invoke an API, very often we have to convert an OAUTH token into a JSON REST token that you enrich with some information about who is calling that API. This is so that the backend service can make some decisions based on who the caller is.
“This is also very important in microservices architecture because the whole point is you don’t know which application is going to call you, and the context in which you are going to be called,” she said. “You design a service that has a certain behavior and scope in what it does, and if you want to adapt as far as who’s calling you, you need some type of information to do that. So we made it easy to validate those tokens.”
WSO2 MS4J also comes with microservices samples to help developers get started quickly. In addition, the framework provides tooling based on the company’s integrated development environment (IDE), WSO2 Developer Studio. The tooling enables developers to launch microservices projects starting from a Swagger API definition.
Swagger is an API description format used by developers in modern programming languages and deployment environments to design and deliver APIs that fuel IoT, microservices and mobile applications in the connected world.
“At WSO2, we are using Swagger as the base notation for services,” Mauny said. “You can annotate your microservice and generate a Swagger description out of that that you can use inside an API management tool, including ours. A lot of third-party API management tools also use Swagger as a way to describe APIs. And then you can do it the other way around. If you start from a description in the interface, you can generate the skeleton of the microservice from that Swagger interface. Those you can do within the Dev Studio IDE.”
The free, open-source WSO2 MS4J was released under the Apache License 2.0.