Two Java Micro-service Framework Msf4j&microserver__java

Source: Internet
Author: User
Tags wso2


msf4j

Github:https://github.com/wso2/msf4j

MSF4J is a Java lightweight and high-performance WSO2 Micro-service framework.

Sample code:

Application.java public class application {    public static  Void main (String[] args)  {        new  Microservicesrunner ()                  .deploy (New helloservice ())            
     .start ();    &NBSP}}//helloservice.java package org.example.service;  import 
Javax.ws.rs.GET;
import javax.ws.rs.path;

import javax.ws.rs.pathparam; @Path ("/hello") public class helloservice {     @GET     @ Path ("/{name}")     public string hello (@PathParam ("name")  string name)  {        return  "hello "  + name;      }

} 

Performance comparisons:

Memory Footprint Comparison:



Microserver

Github:https://github.com/aol/micro-server

Microserver is a 0-configured, standards-based, battle-hardened library that runs Java REST Micro services and is executed through the Java standard main class. It has been used in the AOL production environment since 2014.

Frame structure:

Main class:

public class Apprunnertest {public
static void Main (string[] args) throws Interruptedexception {
new    Microserverapp (()-> "Test-app"). Run ();
}
}

Service class:

@Rest
@Path ("/status") public
class Statusresource {
@GET
@Produces ("Text/plain")
@Path ("/pin  G ") Public
String Ping () {return
" OK ";
}
}


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.