Skip to content

kpavlov/netty-jaxrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JAX-RS Handler for Netty 4.1

Build Status codecov

JAX-RS server handler for Netty 4.1 using Jersey.

Usage

Create resource endpoint:

@Path("/")
public class EchoResource {

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public Response echo() {
        return Response.ok()
                .entity("Hello, World!")
                .build();
    }
}

Setup Jersey Application:

public class JerseyConfig extends ResourceConfig {
   
   public JerseyConfig() {
           setApplicationName("test");
           register(JacksonFeature.class);
           register(LoggingFeature.class);
           register(MultiPartFeature.class);
           // endpoints
           register(EchoResource.class);
   }
}

Start netty server:

JaxrsNettyServer server = new JaxrsNettyServer(
        "localhost", 8080, 
        new JerseyConfig()
    );
server.start();

See integration tests for more examples.

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages