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.""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.
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.