diff --git a/modules/cxf-jetty/pom.xml b/modules/cxf-jetty/pom.xml new file mode 100644 index 0000000..2183d7e --- /dev/null +++ b/modules/cxf-jetty/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + twopm.tech.jax-rs-bench + bom + 1.0-SNAPSHOT + ../../pom.xml + + cxf-jetty + 1.0-SNAPSHOT + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + org.apache.cxf + cxf-rt-transports-http-jetty + ${cxf.version} + + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven.shade.plugin.version} + + + package + + shade + + + false + + + + ${app.main.class} + + + + + + + + + \ No newline at end of file diff --git a/modules/cxf-jetty/src/main/java/twopm/tech/bench/jaxrs/Bench.java b/modules/cxf-jetty/src/main/java/twopm/tech/bench/jaxrs/Bench.java new file mode 100644 index 0000000..be3f418 --- /dev/null +++ b/modules/cxf-jetty/src/main/java/twopm/tech/bench/jaxrs/Bench.java @@ -0,0 +1,27 @@ +package twopm.tech.bench.jaxrs; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; + +public class Bench { + + public static final String BASE_URI = "localhost:8080"; + + public static void main(String[] args) throws IOException, InterruptedException { + JAXRSServerFactoryBean factoryBean = new JAXRSServerFactoryBean(); + factoryBean.setResourceClasses(TestResource.class); + factoryBean.setAddress(BASE_URI); + Server server = factoryBean.create(); + Runtime.getRuntime().addShutdownHook(new Thread(() -> { + try { + server.stop(); + } catch (Exception ex) { + Logger.getLogger(Bench.class.getName()).log(Level.SEVERE, null, ex); + } + })); + Thread.currentThread().join(); + } +} diff --git a/modules/cxf-jetty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java b/modules/cxf-jetty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java new file mode 100644 index 0000000..8ee62a0 --- /dev/null +++ b/modules/cxf-jetty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java @@ -0,0 +1,32 @@ +package twopm.tech.bench.jaxrs; + +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; + +@Path("test") +public class TestResource { + + @GET + @Path("/") + @Produces("application/json") + public String index() { + return "{ \"status\" : \"OK\", \"method\" : \"GET\" }"; + } + + @GET + @Path("{id}") + @Produces("application/json") + public String get(@PathParam("id") Long id) { + return "{ \"status\" : \"OK\", \"method\" : \"GET\", \"test\" : " + String.valueOf(id) + " }"; + } + + @POST + @Path("{id}") + @Produces("application/json") + public String post(@PathParam("id") Long id) { + return "{ \"status\" : \"OK\", \"method\" : \"POST\", \"test\" : " + String.valueOf(id) + " }"; + } +} \ No newline at end of file diff --git a/modules/cxf-netty/pom.xml b/modules/cxf-netty/pom.xml new file mode 100644 index 0000000..379c899 --- /dev/null +++ b/modules/cxf-netty/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + twopm.tech.jax-rs-bench + bom + 1.0-SNAPSHOT + ../../pom.xml + + cxf-netty + 1.0-SNAPSHOT + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + org.apache.cxf + cxf-rt-transports-http-netty-server + ${cxf.version} + + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven.shade.plugin.version} + + + package + + shade + + + false + + + + ${app.main.class} + + + + + + + + + \ No newline at end of file diff --git a/modules/cxf-netty/src/main/java/twopm/tech/bench/jaxrs/Bench.java b/modules/cxf-netty/src/main/java/twopm/tech/bench/jaxrs/Bench.java new file mode 100644 index 0000000..be3f418 --- /dev/null +++ b/modules/cxf-netty/src/main/java/twopm/tech/bench/jaxrs/Bench.java @@ -0,0 +1,27 @@ +package twopm.tech.bench.jaxrs; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; + +public class Bench { + + public static final String BASE_URI = "localhost:8080"; + + public static void main(String[] args) throws IOException, InterruptedException { + JAXRSServerFactoryBean factoryBean = new JAXRSServerFactoryBean(); + factoryBean.setResourceClasses(TestResource.class); + factoryBean.setAddress(BASE_URI); + Server server = factoryBean.create(); + Runtime.getRuntime().addShutdownHook(new Thread(() -> { + try { + server.stop(); + } catch (Exception ex) { + Logger.getLogger(Bench.class.getName()).log(Level.SEVERE, null, ex); + } + })); + Thread.currentThread().join(); + } +} diff --git a/modules/cxf-netty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java b/modules/cxf-netty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java new file mode 100644 index 0000000..8ee62a0 --- /dev/null +++ b/modules/cxf-netty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java @@ -0,0 +1,32 @@ +package twopm.tech.bench.jaxrs; + +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; + +@Path("test") +public class TestResource { + + @GET + @Path("/") + @Produces("application/json") + public String index() { + return "{ \"status\" : \"OK\", \"method\" : \"GET\" }"; + } + + @GET + @Path("{id}") + @Produces("application/json") + public String get(@PathParam("id") Long id) { + return "{ \"status\" : \"OK\", \"method\" : \"GET\", \"test\" : " + String.valueOf(id) + " }"; + } + + @POST + @Path("{id}") + @Produces("application/json") + public String post(@PathParam("id") Long id) { + return "{ \"status\" : \"OK\", \"method\" : \"POST\", \"test\" : " + String.valueOf(id) + " }"; + } +} \ No newline at end of file diff --git a/modules/cxf-undertow/pom.xml b/modules/cxf-undertow/pom.xml new file mode 100644 index 0000000..6d879ce --- /dev/null +++ b/modules/cxf-undertow/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + twopm.tech.jax-rs-bench + bom + 1.0-SNAPSHOT + ../../pom.xml + + cxf-undertow + 1.0-SNAPSHOT + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + org.apache.cxf + cxf-rt-transports-http-undertow + ${cxf.version} + + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven.shade.plugin.version} + + + package + + shade + + + false + + + + ${app.main.class} + + + + + + + + + \ No newline at end of file diff --git a/modules/cxf-undertow/src/main/java/twopm/tech/bench/jaxrs/Bench.java b/modules/cxf-undertow/src/main/java/twopm/tech/bench/jaxrs/Bench.java new file mode 100644 index 0000000..be3f418 --- /dev/null +++ b/modules/cxf-undertow/src/main/java/twopm/tech/bench/jaxrs/Bench.java @@ -0,0 +1,27 @@ +package twopm.tech.bench.jaxrs; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; + +public class Bench { + + public static final String BASE_URI = "localhost:8080"; + + public static void main(String[] args) throws IOException, InterruptedException { + JAXRSServerFactoryBean factoryBean = new JAXRSServerFactoryBean(); + factoryBean.setResourceClasses(TestResource.class); + factoryBean.setAddress(BASE_URI); + Server server = factoryBean.create(); + Runtime.getRuntime().addShutdownHook(new Thread(() -> { + try { + server.stop(); + } catch (Exception ex) { + Logger.getLogger(Bench.class.getName()).log(Level.SEVERE, null, ex); + } + })); + Thread.currentThread().join(); + } +} diff --git a/modules/cxf-undertow/src/main/java/twopm/tech/bench/jaxrs/TestResource.java b/modules/cxf-undertow/src/main/java/twopm/tech/bench/jaxrs/TestResource.java new file mode 100644 index 0000000..8ee62a0 --- /dev/null +++ b/modules/cxf-undertow/src/main/java/twopm/tech/bench/jaxrs/TestResource.java @@ -0,0 +1,32 @@ +package twopm.tech.bench.jaxrs; + +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; + +@Path("test") +public class TestResource { + + @GET + @Path("/") + @Produces("application/json") + public String index() { + return "{ \"status\" : \"OK\", \"method\" : \"GET\" }"; + } + + @GET + @Path("{id}") + @Produces("application/json") + public String get(@PathParam("id") Long id) { + return "{ \"status\" : \"OK\", \"method\" : \"GET\", \"test\" : " + String.valueOf(id) + " }"; + } + + @POST + @Path("{id}") + @Produces("application/json") + public String post(@PathParam("id") Long id) { + return "{ \"status\" : \"OK\", \"method\" : \"POST\", \"test\" : " + String.valueOf(id) + " }"; + } +} \ No newline at end of file diff --git a/modules/resteasy-vertx/pom.xml b/modules/resteasy-vertx/pom.xml index f0cff37..a401229 100644 --- a/modules/resteasy-vertx/pom.xml +++ b/modules/resteasy-vertx/pom.xml @@ -15,13 +15,11 @@ resteasy-vertx ${resteasy.version} - - - io.vertx - vertx-core - 4.2.0 - - + + io.vertx + vertx-core + ${vertx.version} + diff --git a/pom.xml b/pom.xml index 8e4e1cf..6ea7312 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,9 @@ modules/resteasy-reactor-netty modules/resteasy-vertx modules/resteasy-undertow + modules/cxf-jetty + modules/cxf-netty + modules/cxf-undertow twopm.tech.bench.jaxrs.Bench @@ -34,6 +37,7 @@ 4.1.69.Final 2.11.0 3.0.3 + 4.2.0 5.0.0 UTF-8 UTF-8 @@ -41,5 +45,6 @@ io.quarkus.platform 2.4.0.Final 4.7.2.Final + 3.4.5 \ No newline at end of file