Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Jersey jax-rs Plugin

Example Jersey Apps

Plugin that allows the Jersey to be used as the jax-rs implementation with Microserver. (micro-jersey does not include a webserver (such as micro-grizzly, or JSON serializer / deserializer such as micro-jackson-configuration. See micro-grizzly-with-jersey for an end-to-end solution).

To use

Maven Central

Simply add to the classpath

Maven

    <dependency>
       <groupId>com.oath.microservices</groupId>  
       <artifactId>micro-jersey</artifactId>
       <version>x.yz</version>
    </dependency>

Gradle

    compile 'com.oath.microservices:micro-jersey:x.yz'

Baked in async NIO based REST

Return any reactive-streams Publisher from your REST end point to make them execute asynchronously automatically.

E.g. Using Future from cyclops-react

   @GET
   public Future<String> myEndPoint(){
	  return Future.of(()->{
                                           sleep();
                                           return "hello world!";
		}, Executors.newFixedThreadPool(1));
   }

Would be equivalent to the following code

 @GET
 public void myEndPoint(@Suspended AsyncResponse asyncResponse){
      Future.of(()->{
                                           sleep();
                                           asyncResponse.resume("hello world!");
                                           return 1;
		}, Executors.newFixedThreadPool(1));
}