Repository: smallnest/Jax-RS-Performance-Comparison
Branch: master
Commit: 47fd3974b80b
Files: 70
Total size: 145.5 KB
Directory structure:
gitextract_5f2xv914/
├── .gitignore
├── LICENSE
├── README.md
├── TestData.md
├── act/
│ ├── .gitignore
│ ├── README.md
│ ├── pom.xml
│ ├── run_dev
│ ├── run_dev.bat
│ ├── run_e2e
│ ├── run_e2e.bat
│ ├── run_prod
│ └── src/
│ └── main/
│ ├── java/
│ │ └── benchmark/
│ │ └── act/
│ │ └── AppEntry.java
│ └── resources/
│ ├── benchmark/
│ │ └── act/
│ │ └── .version
│ ├── conf/
│ │ ├── app.properties
│ │ ├── prod/
│ │ │ └── app.properties
│ │ └── uat/
│ │ └── app.properties
│ ├── e2e/
│ │ └── scenarios.yml
│ ├── logback.xml
│ └── routes.conf
├── armeria/
│ ├── pom.xml
│ └── src/
│ └── main/
│ ├── java/
│ │ └── com/
│ │ └── colobu/
│ │ └── armeria/
│ │ └── Main.java
│ └── thrift/
│ └── v1/
│ └── main.thrift
├── dropwizard/
│ ├── hello.yml
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── dropwizard/
│ ├── Main.java
│ ├── MyApplication.java
│ ├── MyConfiguration.java
│ └── MyHealthCheck.java
├── go/
│ └── main.go
├── go-fasthttp/
│ └── main.go
├── jaxrs-common/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── jaxrs/
│ ├── HelloResource.java
│ ├── HelloResourceAsync.java
│ └── MyApplication.java
├── jersey-grizzly2/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── jerseygrizzly2/
│ └── Main.java
├── jersey-jetty/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── jerseyjetty/
│ └── Main.java
├── light-java/
│ ├── pom.xml
│ └── src/
│ └── main/
│ ├── java/
│ │ └── Example.java
│ └── resources/
│ ├── META-INF/
│ │ └── services/
│ │ └── com.networknt.server.HandlerProvider
│ └── logback.xml
├── nativenetty/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── nativenetty/
│ ├── HelloWorldHandler.java
│ └── Main.java
├── node.js/
│ ├── install.sh
│ └── server.js
├── pom.xml
├── resteasy-jetty/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── resteasyjetty/
│ └── Main.java
├── resteasy-netty/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── resteasynetty/
│ └── Main.java
├── resteasy-netty4/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── resteasynetty4/
│ └── Main.java
├── resteasy-undertow/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── resteasyundertow/
│ └── Main.java
├── springboot/
│ ├── pom.xml
│ └── src/
│ └── main/
│ ├── java/
│ │ └── com/
│ │ └── colobu/
│ │ └── rest/
│ │ └── springboot/
│ │ ├── HelloController.java
│ │ └── Main.java
│ └── resources/
│ └── application.properties
├── springboot-undertow/
│ ├── pom.xml
│ └── src/
│ └── main/
│ ├── java/
│ │ └── com/
│ │ └── colobu/
│ │ └── rest/
│ │ └── springboot/
│ │ ├── HelloController.java
│ │ └── Main.java
│ └── resources/
│ └── application.properties
├── testdata.xlsx
├── vertx/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── vertx/
│ └── Main.java
└── vertx-verticles/
├── pom.xml
└── src/
└── main/
└── java/
└── com/
└── colobu/
└── rest/
└── vertx/
└── Main.java
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.idea/
.settings/
target/
*.iml
*.log
*.class
dependency-reduced-pom.xml
# mvn versions files
pom.xml.versionsBackup
# eclipse
.classpath
.project
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
# Jax-RS-Performance-Comparison
Performance Comparison of Jax-RS implementations and embedded containers
[](https://drone.io/github.com/smallnest/Jax-RS-Performance-Comparison/latest)
[Gajotres](http://www.gajotres.net/best-available-java-restful-micro-frameworks/#author-box) have written an article: [Top 8 Java RESTful Micro Frameworks](http://www.gajotres.net/best-available-java-restful-micro-frameworks/). He listed 8 best light weight Java RESTful framework.
Personally, I perfer jax-rs implementations and micro frameworks for deploying applications as micro services and those micro services can be deployed in docker containers.
So I have test five Jax-RS implementations plus embedded containers despite business logics. The RESTful service is very simple and it only returns a "hello world" string. Remember, tests don't contain any business logics even JSON libraries.
There are other articles to dicuss serialization framework. For example, [my test](http://colobu.com/2014/08/26/java-serializer-comparison/)
I have added more RESTful framework besides Jax-RS implementation, which contains:
* Spring-boot
* RESTEasy + Netty4
* Native Netty
* Vert.x
* Go
You can check the test result and the performancre chart.
### Compile applications
It is a multiple-module maven project.
You can run "mvn package" in parent directory to packge each module.
It generates a fat-jar in target directories of modules for each module.
It is easy.
### Test Environment
**Server**
AWS C3.2xlarge
- 8 cores (E5-2666 v3 @ 2.90GHz)
- memory: 16G (only allocate 4G for restful applications)
**Java**
1.8.0_51
**Test tool**
[wrk](https://github.com/wg/wrk)
the test cmd is like: `wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello `.
I use 16 threads and 100/200/500/1000 connnections to test each case.
**Starting Server**
```
java -Xmx4g -Xms4g -jar jersey-grizzly2-1.0-SNAPSHOT.jar
java -Xmx4g -Xms4g -jar jersey-jetty-1.0-SNAPSHOT.jar
java -Xmx4g -Xms4g -jar dropwizard-1.0-SNAPSHOT.jar hello.yml
java -Xmx4g -Xms4g -jar resteasy-netty-1.0-SNAPSHOT.jar
java -Xmx4g -Xms4g -jar resteasy-undertow-1.0-SNAPSHOT.jar
java -Xmx4g -Xms4g -jar springboot-1.0-SNAPSHOT.jar
java -Xmx4g -Xms4g -jar resteasy-netty4-1.0-SNAPSHOT.jar
java -Xmx4g -Xms4g -jar nativenetty-1.0-SNAPSHOT.jar
java -Xmx4g -Xms4g -jar vertx-1.0-SNAPSHOT.jar
java -Xmx4g -Xms4g -jar swagger-light-java-1.0.0.jar
```
### Test Result
Test data is [here](TestData.md)

### Conclusion
It looks Resteasy is better than jersey whatever jersey uses grizzly2 or jetty container.
It is predictable that performance of dropwizard is same to jersey+jetty.
Resteasy is excellent in undertow and netty.
To my surprise is resteasy+undertow is a little better than resteasy+netty. Maybe they are all developed by JBoss and they have done some optimization.
I do not recommend you use spring boot in large projects because its performance and style.
Of course native netty is number one but my test has not contains a http router so maybe you can't say it is RESTful framework. But I like its perforamnce.
Performance of RESTEasy+netty4 is lower than what i expect. but RESTEasy+netty3 is very good.
~~One interesting framework is Vert.x. I like its functional programming style but its performance is not so good.~~
I have not monitored the CPU usage and memory usage. You can try it.
### Update
* 2015/11/19 add native go, go-restful codes
================================================
FILE: TestData.md
================================================
### jersey-grizzly2
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.98ms 2.06ms 48.92ms 92.37%
Req/Sec 3.71k 274.18 9.93k 82.39%
1774190 requests in 30.10s, 191.32MB read
Requests/sec: 58944.39
Transfer/sec: 6.36MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.32ms 1.89ms 41.80ms 91.65%
Req/Sec 3.86k 237.06 10.04k 86.86%
1844871 requests in 30.10s, 198.94MB read
Requests/sec: 61292.59
Transfer/sec: 6.61MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 8.14ms 2.35ms 211.50ms 88.87%
Req/Sec 3.84k 365.89 12.98k 96.16%
1835462 requests in 30.10s, 197.92MB read
Requests/sec: 60971.94
Transfer/sec: 6.57MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 16.04ms 3.88ms 224.75ms 88.42%
Req/Sec 3.88k 517.01 22.61k 96.20%
1846019 requests in 30.09s, 199.06MB read
Requests/sec: 61357.23
Transfer/sec: 6.62MB
```
### jersey-jetty
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.09ms 8.88ms 163.37ms 93.57%
Req/Sec 3.51k 675.65 8.22k 72.92%
1677456 requests in 30.10s, 259.16MB read
Requests/sec: 55721.64
Transfer/sec: 8.61MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 5.66ms 11.76ms 216.25ms 94.88%
Req/Sec 3.72k 769.93 12.15k 78.25%
1777091 requests in 30.10s, 274.55MB read
Requests/sec: 59040.40
Transfer/sec: 9.12MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 8.70ms 4.85ms 221.85ms 74.93%
Req/Sec 3.61k 436.24 10.79k 83.47%
1727962 requests in 30.09s, 266.96MB read
Requests/sec: 57420.08
Transfer/sec: 8.87MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 16.38ms 7.79ms 115.97ms 77.13%
Req/Sec 3.80k 387.32 10.29k 75.07%
1817317 requests in 30.08s, 280.77MB read
Requests/sec: 60419.20
Transfer/sec: 9.33MB
```
### resteasy-netty https://github.com/resteasy/Resteasy/tree/master/jaxrs/server-adapters/resteasy-netty4
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.55ms 1.79ms 39.29ms 88.35%
Req/Sec 5.17k 473.68 16.08k 82.22%
2470498 requests in 30.10s, 235.61MB read
Requests/sec: 82078.17
Transfer/sec: 7.83MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.72ms 2.68ms 212.44ms 86.44%
Req/Sec 5.16k 536.58 10.62k 89.71%
2460323 requests in 30.10s, 234.63MB read
Requests/sec: 81742.81
Transfer/sec: 7.80MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.14ms 4.29ms 218.98ms 65.61%
Req/Sec 5.32k 399.82 13.75k 85.94%
2546559 requests in 30.10s, 242.86MB read
Requests/sec: 84604.20
Transfer/sec: 8.07MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 11.73ms 6.59ms 240.40ms 72.53%
Req/Sec 5.29k 735.57 24.29k 95.86%
2530059 requests in 30.09s, 241.29MB read
Requests/sec: 84077.04
Transfer/sec: 8.02MB
```
### resteasy-undertow https://github.com/resteasy/Resteasy/tree/master/jaxrs/server-adapters/resteasy-undertow
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.35ms 1.26ms 29.65ms 89.78%
Req/Sec 5.11k 482.19 13.41k 70.58%
2445424 requests in 30.10s, 319.50MB read
Requests/sec: 81245.94
Transfer/sec: 10.62MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.34ms 1.24ms 20.15ms 82.58%
Req/Sec 5.27k 402.57 10.10k 70.97%
2524874 requests in 30.10s, 329.88MB read
Requests/sec: 83896.30
Transfer/sec: 10.96MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 5.53ms 1.37ms 211.98ms 82.84%
Req/Sec 5.58k 468.63 12.95k 89.39%
2672701 requests in 30.10s, 349.20MB read
Requests/sec: 88808.18
Transfer/sec: 11.60MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 10.71ms 4.21ms 222.46ms 94.80%
Req/Sec 5.63k 1.07k 20.80k 91.21%
2697266 requests in 30.09s, 352.41MB read
Requests/sec: 89646.47
Transfer/sec: 11.71MB
```
### Dropwizard
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 10.56ms 20.00ms 331.02ms 87.74%
Req/Sec 3.69k 1.02k 12.27k 70.18%
1764292 requests in 30.10s, 190.13MB read
Requests/sec: 58617.07
Transfer/sec: 6.32MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 12.31ms 24.45ms 373.46ms 89.65%
Req/Sec 3.73k 1.07k 11.42k 69.94%
1778938 requests in 30.10s, 191.71MB read
Requests/sec: 59104.61
Transfer/sec: 6.37MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 13.47ms 21.35ms 398.83ms 91.93%
Req/Sec 3.79k 1.00k 14.20k 68.85%
1815458 requests in 30.09s, 195.64MB read
Requests/sec: 60338.83
Transfer/sec: 6.50MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 33.55ms 88.33ms 1.20s 95.32%
Req/Sec 3.75k 1.06k 13.18k 69.77%
1791296 requests in 30.09s, 193.04MB read
Requests/sec: 59534.43
Transfer/sec: 6.42MB
```
### spring boot 1.3.0.RELEASE
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.39ms 4.10ms 58.23ms 90.89%
Req/Sec 2.31k 301.34 6.31k 70.86%
1107622 requests in 30.10s, 162.87MB read
Requests/sec: 36799.74
Transfer/sec: 5.41MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.34ms 8.62ms 125.04ms 95.44%
Req/Sec 2.38k 263.37 6.62k 75.76%
1138849 requests in 30.09s, 167.46MB read
Requests/sec: 37847.67
Transfer/sec: 5.57MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 12.99ms 5.43ms 123.32ms 82.28%
Req/Sec 2.43k 183.80 5.77k 76.53%
1161165 requests in 30.09s, 170.74MB read
Requests/sec: 38592.82
Transfer/sec: 5.67MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 25.73ms 4.36ms 72.17ms 78.96%
Req/Sec 2.42k 177.95 6.94k 80.52%
1156937 requests in 30.10s, 170.11MB read
Requests/sec: 38436.42
Transfer/sec: 5.65MB
```
### native netty
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.45ms 2.65ms 46.81ms 90.93%
Req/Sec 8.30k 787.93 12.00k 72.23%
3976832 requests in 30.10s, 379.26MB read
Requests/sec: 132124.20
Transfer/sec: 12.60MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.03ms 2.78ms 208.05ms 90.77%
Req/Sec 8.60k 749.64 13.75k 73.19%
4118101 requests in 30.10s, 392.73MB read
Requests/sec: 136819.26
Transfer/sec: 13.05MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.83ms 3.33ms 47.72ms 88.67%
Req/Sec 9.49k 1.10k 40.84k 87.81%
4540119 requests in 30.10s, 432.98MB read
Requests/sec: 150848.85
Transfer/sec: 14.39MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.51ms 4.04ms 223.29ms 67.61%
Req/Sec 9.88k 1.50k 37.86k 91.72%
4726224 requests in 30.10s, 450.73MB read
Requests/sec: 157019.56
Transfer/sec: 14.97MB
```
### resteasy-netty4
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.02ms 3.21ms 80.07ms 91.22%
Req/Sec 2.45k 253.41 7.26k 78.40%
1169843 requests in 30.10s, 131.65MB read
Requests/sec: 38868.78
Transfer/sec: 4.37MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 5.11ms 3.62ms 63.82ms 72.81%
Req/Sec 2.54k 231.56 8.90k 81.83%
1214528 requests in 30.10s, 136.68MB read
Requests/sec: 40350.45
Transfer/sec: 4.54MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 11.83ms 6.04ms 272.64ms 77.88%
Req/Sec 2.61k 532.48 10.15k 93.05%
1237327 requests in 30.10s, 139.24MB read
Requests/sec: 41110.09
Transfer/sec: 4.63MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 21.91ms 9.22ms 305.95ms 80.44%
Req/Sec 2.59k 0.90k 13.48k 85.05%
1223592 requests in 30.09s, 137.70MB read
Requests/sec: 40663.64
Transfer/sec: 4.58MB
```
### Vert.x 3.2.1
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.66ms 4.62ms 62.15ms 87.53%
Req/Sec 5.96k 746.59 13.79k 71.94%
2851265 requests in 30.10s, 222.97MB read
Requests/sec: 94730.86
Transfer/sec: 7.41MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.50ms 6.72ms 328.68ms 91.33%
Req/Sec 5.86k 1.25k 35.44k 89.77%
2765198 requests in 30.10s, 216.24MB read
Requests/sec: 91869.80
Transfer/sec: 7.18MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.01ms 5.50ms 223.97ms 86.45%
Req/Sec 6.18k 770.53 22.22k 91.66%
2946029 requests in 30.10s, 230.38MB read
Requests/sec: 97880.51
Transfer/sec: 7.65MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 10.59ms 6.59ms 225.84ms 62.30%
Req/Sec 6.04k 610.92 15.94k 89.73%
2891948 requests in 30.10s, 226.15MB read
Requests/sec: 96082.80
Transfer/sec: 7.51MB
```
### Go
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 3.12ms 7.10ms 131.22ms 90.98%
Req/Sec 7.25k 1.67k 15.54k 70.00%
3465942 requests in 30.04s, 423.09MB read
Requests/sec: 115388.10
Transfer/sec: 14.09MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.51ms 9.40ms 199.98ms 91.84%
Req/Sec 6.75k 1.28k 13.88k 69.83%
3225967 requests in 30.04s, 393.79MB read
Requests/sec: 107394.44
Transfer/sec: 13.11MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 13.11ms 23.94ms 394.80ms 89.51%
Req/Sec 7.08k 2.12k 64.25k 73.32%
3378959 requests in 30.09s, 412.47MB read
Requests/sec: 112292.01
Transfer/sec: 13.71MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 33.20ms 62.20ms 908.16ms 89.62%
Req/Sec 7.17k 2.88k 16.91k 68.73%
3417812 requests in 30.04s, 417.21MB read
Requests/sec: 113775.80
Transfer/sec: 13.89MB
```
### go-restful (iris)
```
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.84ms 5.40ms 80.97ms 90.77%
Req/Sec 6.03k 1.65k 19.35k 75.03%
2885226 requests in 30.09s, 319.18MB read
Requests/sec: 95899.44
Transfer/sec: 10.61MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c200 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.90ms 7.72ms 104.81ms 87.61%
Req/Sec 6.61k 1.01k 15.55k 70.15%
3162116 requests in 30.07s, 349.81MB read
Requests/sec: 105175.35
Transfer/sec: 11.64MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
[root@ip-172-31-4-198 ~]# wrk -t16 -c500 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 14.58ms 23.04ms 278.81ms 86.94%
Req/Sec 6.90k 1.02k 12.04k 69.27%
3297379 requests in 30.03s, 364.78MB read
Requests/sec: 109786.38
Transfer/sec: 12.15MB
[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
16 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 35.13ms 57.20ms 553.38ms 86.80%
Req/Sec 6.91k 1.05k 18.11k 70.85%
3309745 requests in 30.10s, 366.14MB read
Requests/sec: 109966.09
Transfer/sec: 12.17MB
```
================================================
FILE: act/.gitignore
================================================
*.iml
target
.idea
classes
*.log
*.DS_Store
*all.sql
tmp/
**/.act*
**/.classpath
**/.settings
**/.project
**/.settings/
store1/
test.mv.db
test.trace.db
act.pid
.workspace
*.geany
================================================
FILE: act/README.md
================================================
# Jax-RS-Performance-Comparison - ActFramework implementation
[ActFramework](https://github.com/actframework/actframework) is a Java based full stack framework, could be used to quickly develop MVC or RESTful service application.
## Requirements
You must have Java 7+ and maven to run this application.
## Run
To run this application in PROD mode, type `./run_prod`.
This application is configured to listen on port `8080`
## Test
To run end to end test, type `./run_e2e`
================================================
FILE: act/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>benchmark.act</groupId>
<artifactId>rest-hello</artifactId>
<version>1.0-SNAPSHOT</version>
<name>act</name>
<parent>
<groupId>org.actframework</groupId>
<artifactId>act-starter-parent</artifactId>
<version>1.8.8.4</version>
</parent>
<properties>
<!-- remove the following line if you are on Java 7-->
<java.version>1.8</java.version>
<app.entry>benchmark.act.AppEntry</app.entry>
</properties>
<dependencies>
<dependency>
<groupId>org.actframework</groupId>
<artifactId>act-e2e</artifactId>
<version>0.0.7</version>
</dependency>
</dependencies>
</project>
================================================
FILE: act/run_dev
================================================
#!/bin/sh
echo building ...
mvn -q compile act:run
================================================
FILE: act/run_dev.bat
================================================
echo building ...
mvn -q compile act:run
================================================
FILE: act/run_e2e
================================================
#!/bin/sh
echo building ...
mvn -q compile act:e2e
================================================
FILE: act/run_e2e.bat
================================================
echo building ...
mvn -q compile act:e2e
================================================
FILE: act/run_prod
================================================
#!/bin/sh
if [ ! -f target/dist/start ]; then
echo building ...
mvn -q clean package
cd target/dist
tar xzf *.tar.gz
else
cd target/dist
fi
./run $*
================================================
FILE: act/src/main/java/benchmark/act/AppEntry.java
================================================
package benchmark.act;
import act.Act;
/**
* A simple hello world service app entry
*
* Run this app, try to update some of the code, then
* press F5 in the browser to watch the immediate change
* in the browser!
*/
@SuppressWarnings("unused")
public class AppEntry {
public static void main(String[] args) throws Exception {
Act.start();
}
}
================================================
FILE: act/src/main/resources/benchmark/act/.version
================================================
artifact=${project.artifactId}
version=${project.version}
build=${buildNumber}
================================================
FILE: act/src/main/resources/conf/app.properties
================================================
##############################################
# Application configuration
# act-1.8.8-RC8
##############################################
# When `api_doc` is enabled it can navigate to
# http://localhost:5460/~/apidoc
# for API Document.
#
# API doc is enabled by default
#
# uncomment to disable API doc
#api_doc=false
# When `api_doc.built_in.hide` is enabled the API document
# will not display built-in endpoints, e.g.
# `/~/info`
#
# built-in endpoints is visible in API doc by default
#
# uncomment to hide built-in endpoints in API doc
#api_doc.built_in.hide=true
# `basic_authentication` is not used by actframework
# core, however plugins like `act-aaa-plugin` use
# this configuration to check if HTTP basic
# authentication is allowed.
#
# basic authentication is disabled by default
#
# uncomment to enable basic authentication
#basic_authentication=true
# When `built_in_req_handler` is disabled it will
# not be able to access framework built-in endpoints
# including `/~/info`, `/~/version` etc.
# However the following built-in endpoints is still
# available:
# * GET /~/job/{id}/progress - required by runtime application
# * GET /~/api/book/** - only available in dev mode
#
# built-in endpoints is enabled by default
#
# uncomment to disable built endpoints
#built_in_req_handler=false
# Configure the cache implementation used by ActFramework.
# The cache class specified must implement
# `org.osgl.cache.CacheServiceProvider` interface.
#
# If not specified cache implementation is determined by
# osgl-cache library automatically depending on the
# libraries available in the following order:
# 1. Memcached service
# 2. EhCache service
# 3. OSGL implemented Simple Cache service based on concurrent hash map
#
# uncomment to set your own cache implementation
#cache.impl=
# By default @CacheFor annotation is not effective in `dev` mode.
# the `cacheFor.dev` configuration can be used to turn on
# @CacheFor in `dev` mode.
#
# uncomment to enable @CacheFor annotation in `dev` mode
#cacheFor.dev=true
# CLI service listens to local ip addresses to provide telent
# access for command line access to the running app.
#
# CLI service is enabled by default
#
# uncomment to disable CLI service
#cli=false
# By default CLI port is `5461`
#
# uncomment to set CLI port
#cli.port=
# `cli.page.size.json` specifies the number of records to display
# per page for CLI JSON view.
#
# Default CLI JSON view page size is 10 records
#
# uncomment to set CLI JSON view page size
#cli.page.size.json=
# `cli.page.size.table` specifies the number of records to display
# per page for CLI tabular view.
#
# Default CLI table view page size is 22 records
#
# uncomment to set CLI table view page size
#cli.page.size.table=
# `cli.session.ttl` specifies the number of seconds a CLI
# session will be terminated without interaction.
#
# The default CLI session ttl is 300 seconds, i.e. 5 minutes
#
# uncomment to set CLI session ttl
#cli.session.ttl
# `cli.session.max.int` specifies the maximum concurrent CLI session
#
# The default limits is 3
#
# uncomment to set CLI session max
#cli.session.max.int
# `cookie.prefix` specifies the session/flash cookie prefix.
#
# The default cookie prefix is the `shortId` of the application.
#
# uncomment to customize session/flash cookie prefix.
#cookie.prefix=
# When `cors` is enabled ActFramework will automatically populate the
# CORS relevant headers in HTTP response.
#
# When `cors` is disabled all other `cors` relevant settings is not effective.
#
# By default `CORS` is disabled
#
# uncomment to enable CORS support
#cors=true
# `cors.origin` set the `Access-Control-Allow-Origin` response header.
#
# Default CORS origin header value is `*`
#cors.origin=
# `cors.headers` set the `Access-Control-Expose-Headers` response header.
#
# Default value is `Content-Type, X-HTTP-Method-Override`
#cors.headers=
# `cors.headers.expose` set the `Access-Control-Expose-Headers` response header.
#
# Default value is empty.
#cors.headers.expose=
# `cors.headers.allowed` set the `Access-Control-Allow-Headers` response header.
#
# Default value is empty.
#cors.headers.allowed=
# `cors.max_age` set the `Access-Control-Max-Age` response header
#
# Default value is `30*60` i.e. 30 minutes
#cors.max_age
# `cors.allow_credentials.enabled` set the `Access-Control-Allow-Credential` response header
#
# By default this setting is disabled
#
# Uncomment the set `Access-Control-Allow-Credential` to `true`
#cors.allow_credentials=true
# If `content_suffix.aware` is enabled the framework adjust Request `Accept`
# header based on URL suffix.
#
# E.g. `/customer/123/json` will match the route `/customer/123`
# and set the `Accept` header of the incoming request to `application/json`
#
# By default `content_suffix.aware` is disabled.
#
# Uncomment to enable `content_suffix.aware.enabled`
#content_suffix.aware.enabled=true
# `csp` set the `Content-Security-Policy` response header value.
#
# By default `csp` is not set.
#csp=
# `csrf` turn on/off the CSRF protection.
# See https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)
#
# By default `csrf` protection is disabled
#
# uncomment to turn on CSRF protection.
#csrf=true
# `csrf.param_name` specifies the http request param name
# used to convey the csrf token.
#
# Default value: `__csrf__`
#csrf.param_name
# `csrf.header.name` specifies name of the http request header
# used to convey the csrf token sent from AJAX client.
#
# Default value: `X-Xsrf-Token`
#csrf.header_name=
# `csrf.cookie_name` specify the name of the cookie used to
# convey the csrf token generated on the server for the first GET
# request coming from a client.
#
# Default value: `XSRF-TOKEN`
#csrf.cookie_name
# `csrf.protector` specifies the implementation of `act.security.CSRFProtector`.
#
# Default protector implementation is `HMAC`
#
# uncomment to set csrf protector implementation
#csrf.protector=RANDOM|className
# `db.seq_gen` specifies the implementation of `act.db.util._SequenceNumberGenerator`
#
# Default value is `null` or an implementation specified by db plugin
#db.seq_gen=
# `dsp.token` specifies the name of "double submission protect token"
#
# Default value: `act_dsp_token`
#dsp.token=
# `enum.resolving.exact_match` specify whether it shall resolve enum value
# in exact matching way or Keyword based variation way.
#
# Keyword based variation matching explain:
#
# Suppose we have an enum defination: `enum TestEnum {FOO_BAR}
# All the following string variations can be resolved to `TestEnum.FOO_BAR`:
#
# * FOO_BAR
# * Foo-Bar
# * Foo.Bar
# * foo-bar
# * foo_bar
# * FooBar
# * fooBar
#
# Default value is `false` meaning enum type value resolving is
# non-exact matching
#
# uncomment to make Enum type parameter resolving be exact matching
#enum.resolving.exact_match=false
# `fmt.date` specifies the pattern for Date type value resolving
#
# The setting can be any one of
# - long
# - medium
# - short
# - custom pattern, e.g. `EEE yyyy MMM dd`
#
# Note custom pattern shall not contain any symbol for time, e.g. `H` or `m`
# Default value: `medium`
#fmt.date=
# `fmt.<locale>.date` specifies the pattern for Date type for specific locale
#
# It can specify date formats for multiple locales
#
# Default value: `medium`
# see also: `fmt.date`
#fmt.zh_cn.date=yyyy年MM月dd日
# `fmt.data_time` specifies the pattern for DataTime type value resolving.
#
# The setting can be any one of
# - long
# - medium
# - short
# - custom pattern, e.g. `EEE yyyy MMM dd`
#
# Default value: `medium`
#fmt.date_time=
# `fmt.<locale>.date_time` specifies the pattern for DateTime type for specific locale
#
# It can specify date_time formats for multiple locales
#
# Default value: `medium`
# see also: `fmt.date_time`
#fmt.zh_cn.date_time=yyyy年MM月dd日 HH:mm
# `fmt.time` specifies the pattern for Time type value resolving
#
# The setting can be any one of
# - long
# - medium
# - short
# - custom pattern, e.g. `HHmmss`
#
# Note custom pattern shall not contain any symbol for date, e.g. `y` or `M`
# Default value: `medium`
#fmt.time=
# `fmt.<locale>.time` specifies the pattern for Time type for specific locale.
#
# It can specify time formats for multiple locales
#
# Default value: `medium`
# see also: `fmt.time`
#fmt.zh_cn.time=HH:mm
# `handler.csrf_check_failure` specifies the implemetation of `MissingAuthenticationHandler`
# to be called when CSRF checking failed.
#
# Default value is the setting of `handler.missing_authentication`
#handler.csrf_check_failure=
# `handler.missing_authentication` specifies the implemetation of `MissingAuthenticationHandler`
# to be called when authentication is failed on an non-AJAX request.
#
# Default value is `act.util.RedirectToLoginUrl` if login URL is in the route table.
# otherwise it is `act.util.ReturnUnauthorized`
#handler.missing_authentication=
# `handler.missing_authentication` specifies the implemetation of `MissingAuthenticationHandler`
# to be called when authentication is failed on an AJAX request.
#
# Default value is the setting of `handler.missing_authentication`
#handler.missing_authentication.ajax=
# `handler.unknown_http_method` specifies the handler implementation to be called
# when ActFramework found the HTTP method of an incoming request is not supported
#
# Default value is `UnknownHttpMethodProcessor.METHOD_NOT_ALLOWED`, i.e.
# respond `405 Method Not Allowed` response.
#handler.unknown_http_method=
# `act.header.overwrite` turn on/off HTTP HEADER overwrite.
#
# Once this config is turned on, then it can overwrite header
# with HTTP Query parameter or HTTP post form field. The naming
# convention of the param/field is:
#
# ```
# act_header_<header_name_in_lowercase_and_underscore>
# ```
#
# For example, if it needs to overwrite `Content-Type`, use
# `act_header_content_type` as the query parameter name.
#
# Default value: `false`
#header.overwrite=true
# `header.session.expiration` specifies name of the HTTP response header to be
# used to convey the JWT/session cookie expiration time.
#
# Default value is `Act-Session-Expires`
#header.session.expiration=
# `host` specifies the hostname of the application.
#
# This setting is often used to concatentate full URL including host
# in email template.
#
# Default value: `localhost`
#host=
# `http.external_server` specify if the app is running behind a frontend
# http server, e.g. nginx.
#
# Default value: `true` when running in `prod` mode or `false` when running in `dev` mode
#http.external_server=true|false
# `http.params.max` specifies the maximum number of http parameters.
#
# This setting can be to prevent the hash collision DOS attack.
#
# Default value: 128
#http.params.max=
# `http.port` specifies the default HTTP port number
#
# Default value: 5460
http.port=8080
# `http.port.external` specifies the default HTTP port number of
# frontend HTTP server (if exists).
#
# Default value: 80
#http.port.external=
# `http.port.external.secure` specifies the default HTTPS port number of
# the frontend HTTP server (if exists)
#
# Default value: 443
#http.port.external.secure=
# `http.secure` specifies whether the default http port is running in
# an secure HTTP channel
#
# Default value: `true` when running in `prod` mode or `false` in `dev` mode
#http.secure=true|false
# `https.port` specify the https port - only effect
# when `ssl` is enabled.
#
# Default value: `5443`
#https.port=
# `i18n` turn on/off i18n support in ActFramework.
#
# Default value: false
#i18n=true|false
# `i18n.locale.param_name` specifies the param name to set client locale
# in http request
#
# Default value: `act_locale`
#i18n.locale.param_name=
# `i18n.locale.cookie_name` specifies the name for the locale cookie
#
# Default value: `act_locale`
#i18n.locale.cookie_name=
# `idgen.node_id.provider` specifies the implementation of
# `act.util.IdGenerator.NodeIdProvider` which is called when generating the
# CUID (Custer Unique Identifier)
#
# Default value: `act.util.IdGenerator.NodeIdProvider.IpProvider`
#idgen.node_id.provider=
# `idgen.node_id.effective_ip_bytes.size` specifies how many bytes in the ip address
# will be used to calculate node ID. Usually in a cluster environment, the ip address will
# be different at only (last) one byte or (last) two bytes, in which case it could set this
# configuration to `1` or `2`. When the configuration is set to `4` then it means all 4 IP
# bytes will be used to calculate the node ID
#
# Default value: 4
#idgen.node_id.effective_ip_bytes.size=1|2|3|4
# `idgen.start_id.provider` specifies the `act.util.IdGenerator.StartIdProvider`
# implementation which is called when generating the CUID
#
# Default value: `act.util.IdGenerator.StartIdProvider.DefaultStartIdProvider`
# which read/write the file specified by `idgen.start_id.file` setting in
# the project dir.
#idgen.start_id.provider=
# `idgen.start_id.file` specifies the start id persistent file.
# This setting is used by `act.util.IdGenerator.StartIdProvider.DefaultStartIdProvider`
#
# Default value: `.act.id-app`
#idgen.start_id.file=
# `idgen.seq_id.provider` specifies the `act.util.IdGenerator.SequenceProvider`
# implementation which is called when generating the CUID.
#
# Default value: `act.util.IdGenerator.SequenceProvider.AtomicLongSeq`
#idgen.seq_id.provider=
# `idgen.encoder` specifies the `act.util.IdGenerator.LongEncoder` implementation
# which is called when generating the CUID.
#
# Default value: `act.util.IdGenerator.SafeLongEncoder` which generates URL
# safe and slighty longer string for long value encoding.
#idgen.encoder=act.util.IdGenerator.SafeLongEncoder|act.util.IdGenerator.UnsafeLongEncoder
# `job.pool.size` specifies the maximum number of threads
# can exists in the application's job manager's thread pool
#
# Default value: 10
#job.pool.size=
# `jwt` enable/disable JWT support.
# This is actually a combination of the following settings:
# * session.codec=act.session.JsonWebTokenSessionCodec
# * session.header.payload.prefix="Bearer " # note the space after `Bearer`
# * session.header=Authorization
#jwt=true|false
# `jwt.algo` specifies the algorithm used to encrypt/decrypt JWT.
#
# Default value: SHA256
#jwt.algo=SHA256|SHA384|SHA512
# `jwt.issuer` specify `iss` payload of JWT
#
# Default value: the setting of `cookie.prefix`
#jwt.issuer=
# `locale` specifies the application default locale
#
# Default value: the result of calling `java.util.Locale#getDefault()`
#locale=
# `metric` turn on/off internal metrics.
#
# Default value: true
#metric=true|false
# `modules` declare additional app base (for multi-module maven projects)
#modules=
# `namedPorts` specifies a list of port names this
# application listen to. These are additional ports other than
# the default `http.port` setting.
#
# Default value: null
#namedPorts=admin:8888;ipc:8899;...
# `password.spec` specify default password spec which is used to
# validate user password.
#
# Default value:
# * dev mode: `a[3,]`, meaning require lower case letter and min length is 3 characters.
# * prod mode: `aA0[6,]`, meaning require lower case letter, uppercase letter, digit and min length is 6 characters.
#
# Developer can also specify a `Password.Validator` implementation
# class for this configuration, in which case, the framework will instantiate the user
# specified validator instead of `act.validation.PasswordSpec` as the default
# password validator.
#
#password.spec=
# `ping.path` specify the ping path.
# If this setting is specified, then when session resolving, system
# will check if the current URL matches the setting. If matched
# then session cookie expiration time will not be changed. Otherwise
# the expiration time will refresh
#
# Default value: `null`
#ping.path=
# `req.throttle` specifies the maximum number of requests
# that can be handled per second from the same ip address
# when `@Throttled` annotation is presented without `value`
# specified on a request handler method.
#
# Default value: 2
#req.throttle=
# `req.throttle.expire.scale` turn on/off request throttle
# expiry time increment.
#
# Default value: `false`
#req.throttle.expire.scale=true|false
# `render.json.content_type.ie` specify whether the content type
# of JSON response on request initiated from an IE browser.
#
# Note early IE browser does not support the `application/json` content type.
#
# Default value: `null`
#render.json.content_type.ie=
# `resolver.template_path` specifies the class that extends
# `TemplatePathResolver`. Application developer could use this
# configuration to add some flexibility to
# template path resolving logic, e.g. different home
# for different locale or different home for different device
# type etc
#
# Defautl value: `TemplatePathResolver`
#resolver.template_path
# `resource.preload.size.limit` Specifies the maximum number of bytes of
# a resource that can be preload into memory. Specify the setting to
# `0` or negative value disable resource preload feature.
#
# Default value: `1024 * 10`, i.e. 10KB
#resource.preload.size.limit=
# `scan_package` specify the app package in which all classes is subject
# to bytecode processing, e.g enhancement and injection.
#
# By default ActFramework will infer the scan package
# from the app entry class which contains the main method
# starting act.
#
#scan_package=
# `act.secret` Specifies the secret key the application used to do general
# encrypt/decrypt/sign etc
#
# Note application must set this configuration to secure the communication
act.secret=7cCKNhrzENbuyPtUIHaiYny2UmAwY00ww5l2yHC2K1AS8m06gJ97NjyREl27joUn
# `secret.rotate` turn on app secret rotation for session/flash
# token signing and encrypt. This feature makes it even harder
# to crack as secret changes regularly.
#
# Default value: false
#secret.rotate=true|false
# `secret.rotate.period` set the secret rotate period in terms of minute.
#
# **Note** the number of minute must be a factor of 60. Any number that
# is not the factor of 60 then it will be up rounded:
#
# * 1 -> 1
# * 2 -> 2
# * 3 -> 4
# * 4 -> 4
# * 5 -> 5
# * 6 -> 6
# * 7 -> 10
# * 8 -> 10
# * 33 -> 30
# * 50 -> 60
#
# the rotation period less than hour will be count from the beginning of
# the current hour.
#
# If the number minutes exceeds 60, then it must be a factor of 60 * 24. Any
# number if not will be rounded:
#
# * 65 -> 60
# * 60 * 3 -> 60 * 3
# * 60 * 5 -> 60 * 6
# * 60 * 7 -> 60 * 6
# * 60 * 10 -> 60 * 12 (half day)
#
# if the number of minutes equals of exceeds 120, the rotation period will
# be counted from the beginning of the day.
#
# The maximum period is `60 * 24`, i.e. 24 hours. Any setting exceed that number
# will be cut off down to 24 hours.
#
# Default value: `30` minutes, ie. half an hour
#secret.rotate.period=
# `server.header` specifies the server header to be output to the response
#
# Default value: `act/${act-version}`
#server.header=
#`session.outputExpiration.enabled` turn on/off expiration output to
# response header.
#
# This setting only effective when it is using token to
# map session payload.
#
# Default value: `true`
#session.outputExpiration=true|false
# `session.ttl` specifies the session duration in seconds.
# If user failed to interact with server for amount of time that
# exceeds the setting then the session will be destroyed
#
# Default value: `60 * 30` i.e half an hour
#session.ttl=
# `session.persistent` specify whether the system
# should treat session cookie as persistent cookie. If this setting
# is enabled, then the user's session will not be destroyed after
# browser closed.
#
# Refer to http://en.wikipedia.org/wiki/HTTP_cookie#Persistent_cookie
#
# Default value: `false`
#session.persistent=true|false
# `session.encrypted` specify whether the system should
# encrypt the key/value pairs in the session cookie. Enable session
# encryption will greatly improve the security but with the cost
# of additional CPU usage and a little bit longer time on request
# processing.
#
# Default value: `false`
#session.encrypted=true|false
# `session.key.username` specifies the session key for username
#
# Default value: `username`
#session.key.username=
# `session.mapper` specifies the implementation of `act.session.SessionMapper`
# Predefined session mappers:
# * `act.session.CookieSessionMapper` - map session data to session cookie
# * `act.session.HeaderTokenSessionMapper` - map session data to header token
# * `act.session.CookieAndHeaderSessionMapper` - map session data to both cookie and header
#
# Default value:`act.session.CookieSessionMapper`
#session.mapper=
# `session.codec` specifies the implementation of `act.session.SessionCodec`
# Predefined session codec:
# * `act.session.DefaultSessionCodec`
# * `act.session.JsonWebTokenSessionCodec`
#
# Default value: `act.session.DefaultSessionCodec` when `jwt` is `false`
# or `act.session.JsonWebTokenSessionCodec` when `jwt` is `true`
#session.codec=
# `session.header` - specify the session header name.
#
# Effective only when `act.session.SessionMapper` is `act.session.HeaderTokenSessionMapper`
#
# Default value: X-Act-Session when `jwt` is `false`
# or `Authorization` when `jwt` is `true`
#session.header=
# `session.header.payload.prefix` set the session payload prefix, e.g. `Bearer `
#
# Default value: `null` when `jwt` is `false`
# or `Bearer ` when `jwt` is `true`
#session.header.payload.prefix=
# `session.secure` specifies whether the session cookie should
# be set as secure. Enable secure session will cause session cookie only
# effective in https connection. Literally this will enforce the web site to run
# default by https.
#
# Default value: `true`
#
# **Note** when {@link Act Act server} is running in {@link Act.Mode#DEV mode}
# session http only will be disabled without regarding to the `session.secure.enabled`
# setting
#session.secure=true|false
# `source.version` specifies the java version
# of the src code. This configuration is used only
# in dev mode.
#
# Default value: 1.7
#source.version=
# `ssl` turn on/off SSL support.
#
# Default value: `false`
#
# **Note** this is experimental feature
#ssl=true|false
# `target.version` specifies the java version of the compile
# target code. This configuration is used only in dev mode.
#
# Default value: 1.7
#target.version=
# `template.home` specifies where the view templates resides.
# If not specified then will use the {@link View#name() view name
# in lower case} as the template home if that view is used.
#
# Default value: the result of `View.name()`
#template.home=
# `threadlocal_buf.limit` set the maximum buffer size of thread local instance
# of `org.osgl.util.S.Buffer` and `org.osgl.util.ByteArrayBuffer`. If the buffer
# size exceeds the limit, the thread local instance will be dropped and new
# instance will be created as the thread local instance.
#
# Default value: 1024 * 8 (i.e. 8k)
#threadlocal_buf.limit=
# `trace.handler` turn on/off handle invocation calls.
#
# When this configuration is turned on, every call to the
# action handler/job handler/mail sender method will be logged.
#
# Default value: `false`
#trace.handler=true|false
# `trace.request` turn on/off incoming request log
#
# When this configuration is turned on, every incoming request
# will be logged
#
# default value: `false`
#trace.request=true|false
# `upload.in_memory.threshold`
#
# If file upload content length is less than this configuration then
# the file will not get written into disk, instead it will get cached
# into a in memory byte array
#
# Default value: `1024 * 10`
#upload.in_memory.threshold
# `url.context` specifies the app global URL context.
#
# If this configuration is specified then all route configured will
# be attached to the configured context path.
#
# Default value: `null`
#url.context=
# `url.login` specifies the login URL which is used
# by {@link act.util.RedirectToLoginUrl}
#
# Default value: `/login`
#url.login=
# `url.login.ajax` specifies the login URL which is used
# by {@link act.util.RedirectToLoginUrl} when request is AJAX
#
# Default value: the value of `url.login` setting
#url.login.ajax
# `view.default` specifies the default view solution. If there
# are multiple views registered and default view are available, then
# it will be used at priority to load the templates
#
# Default value: `rythm`
#view.default=
================================================
FILE: act/src/main/resources/conf/prod/app.properties
================================================
##############################################
# Application configuration for prod profile
# act-1.8.8-RC8
##############################################
act.secret=mHklV2nkYwkWAVuWRulJfkNnncZ4j3yvFoFzi9hfH94kmg0HM0ZcJxQoxM26vg3t
================================================
FILE: act/src/main/resources/conf/uat/app.properties
================================================
##############################################
# Application configuration for uat profile
# act-1.8.8-RC8
##############################################
act.secret=bHn8o3k7r9tKuCFgRFjKVUwVVxxUcZXRynuMWgzK0zBJUBeh6q9UQJh0cIXz0NUu
================================================
FILE: act/src/main/resources/e2e/scenarios.yml
================================================
Scenario(REST Hello Service):
description: a service says hello
interactions:
- description: send request to hello service without parameter
request:
method: GET
url: /rest/hello
response:
text: Hello world # response text must be "Hello world"
================================================
FILE: act/src/main/resources/logback.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<!-- Send debug messages to System.out -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- By default, encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<withJansi>true</withJansi>
<encoder>
<pattern>%date %highlight(%-5level) %cyan(%logger{5}@[%-4.30thread]) - %msg%n</pattern>
</encoder>
</appender>
<!-- Console output for act-e2e test log -->
<appender name="E2E_STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- By default, encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<withJansi>true</withJansi>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>
<!-- main log file -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>act.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{yyyy-MM-dd_HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>/act.%i.log.zip</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>10</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>2MB</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- act-e2e test log file -->
<appender name="E2E_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>e2e.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%msg%n</Pattern>
</encoder>
</appender>
<appender name="DB_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>act-db.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{yyyy-MM-dd_HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>/act-db.%i.log.zip</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>10</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>2MB</MaxFileSize>
</triggeringPolicy>
</appender>
<appender name="METRIC_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>act-metric.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{yyyy-MM-dd_HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>/act-metric.%i.log.zip</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>10</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>2MB</MaxFileSize>
</triggeringPolicy>
</appender>
<logger name="act" level="INFO" additivity="false">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</logger>
<logger name="act.mail" level="DEBUG" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="act.db" level="INFO" additivity="false">
<appender-ref ref="DB_FILE" />
</logger>
<logger name="act.e2e" level="INFO" additivity="false">
<appender-ref ref="E2E_STDOUT"/>
<appender-ref ref="E2E_FILE"/>
</logger>
<logger name="act.metric" level="TRACE">
<appender-ref ref="METRIC_FILE" />
</logger>
<logger name="benchmark.act" level="DEBUG" additivity="false">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</logger>
<!-- By default, the level of the root level is set to INFO -->
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
================================================
FILE: act/src/main/resources/routes.conf
================================================
GET /rest/hello echo:Hello world
================================================
FILE: armeria/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.colobu</groupId>
<artifactId>armeria</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<netty.version>4.1.0.CR7</netty.version>
<armeria.version>0.97.0</armeria.version>
<thrift.version>0.9.3</thrift.version>
</properties>
<dependencies>
<dependency>
<groupId>com.linecorp.armeria</groupId>
<artifactId>armeria</artifactId>
<version>${armeria.version}</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.apache.thrift</groupId>-->
<!--<artifactId>libthrift</artifactId>-->
<!--<version>${thrift.version}</version>-->
<!--</dependency>-->
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>dtrott</id>
<url>https://maven.davidtrott.com/repository</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.armeria.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.armeria.Main</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.thrift.tools</groupId>
<artifactId>maven-thrift-plugin</artifactId>
<version>0.1.10</version>
<!--<configuration>-->
<!--<thriftExecutable>/usr/local/bin/thrift</thriftExecutable>-->
<!--</configuration>-->
<executions>
<execution>
<id>thrift-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>thrift-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: armeria/src/main/java/com/colobu/armeria/Main.java
================================================
package com.colobu.armeria;
import com.colobu.armeria.service.thrift.v1.HelloService;
import com.linecorp.armeria.common.SerializationFormat;
import com.linecorp.armeria.common.SessionProtocol;
import com.linecorp.armeria.server.Server;
import com.linecorp.armeria.server.ServerBuilder;
import com.linecorp.armeria.server.docs.DocService;
import com.linecorp.armeria.server.thrift.ThriftService;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
public class Main {
public static void main(String[] args) {
HelloService.AsyncIface helloHandler = new HelloService.AsyncIface(){
@Override
public void hello(AsyncMethodCallback resultHandler) throws TException {
resultHandler.onComplete("Hello world");
}
};
ServerBuilder sb = new ServerBuilder();
sb.port(8080, SessionProtocol.HTTP);
sb.serviceAt("/hello", ThriftService.of(helloHandler, SerializationFormat.THRIFT_BINARY))
.serviceUnder("/docs/", new DocService());
Server server= sb.build();
server.start();
}
}
================================================
FILE: armeria/src/main/thrift/v1/main.thrift
================================================
namespace java com.colobu.armeria.service.thrift.v1
service HelloService {
string hello()
}
================================================
FILE: dropwizard/hello.yml
================================================
server:
type: default
rootPath: /rest/*
applicationConnectors:
- type: http
bindHost: 0.0.0.0
port: 8080
adminConnectors:
- type: http
bindHost: 127.0.0.1
port: 8081
logging:
level: INFO
loggers:
"com.colobu.rest.dropwizard": DEBUG
================================================
FILE: dropwizard/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dropwizard</artifactId>
<dependencies>
<dependency>
<artifactId>jaxrs-common</artifactId>
<groupId>com.colobu</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<version>${dropwizard.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.rest.dropwizard.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.dropwizard.Main</mainClass>
<arguments>
<argument>server</argument>
<argument>${project.basedir}/hello.yml</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: dropwizard/src/main/java/com/colobu/rest/dropwizard/Main.java
================================================
package com.colobu.rest.dropwizard;
public class Main {
public static void main(String[] args) throws Exception {
new MyApplication().run(args);
}
}
================================================
FILE: dropwizard/src/main/java/com/colobu/rest/dropwizard/MyApplication.java
================================================
package com.colobu.rest.dropwizard;
import com.colobu.rest.jaxrs.HelloResource;
import com.colobu.rest.jaxrs.HelloResourceAsync;
import io.dropwizard.Application;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
public class MyApplication extends Application<MyConfiguration> {
@Override
public String getName() {
return "rest";
}
@Override
public void initialize(Bootstrap<MyConfiguration> bootstrap) {
// nothing to do yet
}
@Override
public void run(MyConfiguration myConfiguration, Environment environment) throws Exception {
environment.healthChecks().register("healthcheck", new MyHealthCheck());
environment.jersey().register(new HelloResource());
environment.jersey().register(new HelloResourceAsync());
}
}
================================================
FILE: dropwizard/src/main/java/com/colobu/rest/dropwizard/MyConfiguration.java
================================================
package com.colobu.rest.dropwizard;
import io.dropwizard.Configuration;
// add configuration if necessary.
public class MyConfiguration extends Configuration {
}
================================================
FILE: dropwizard/src/main/java/com/colobu/rest/dropwizard/MyHealthCheck.java
================================================
package com.colobu.rest.dropwizard;
import com.codahale.metrics.health.HealthCheck;
public class MyHealthCheck extends HealthCheck {
@Override
protected Result check() throws Exception {
//Result.unhealthy
return Result.healthy();
}
}
================================================
FILE: go/main.go
================================================
package main
import (
"log"
"net/http"
)
// There are some golang RESTful libraries and mux libraries but i use the simplest to test.
func main() {
http.HandleFunc("/rest/hello", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello world"))
})
err := http.ListenAndServe(":8080", nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}
================================================
FILE: go-fasthttp/main.go
================================================
package main
import (
"log"
"github.com/valyala/fasthttp"
)
func main() {
err := fasthttp.ListenAndServe(":8080", fastHTTPHandler)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}
func fastHTTPHandler(ctx *fasthttp.RequestCtx) {
if string(ctx.Method()) == "GET" {
switch string(ctx.Path()) {
case "/rest/hello":
ctx.Write([]byte("Hello world"))
default:
ctx.Error("Unsupported path", fasthttp.StatusNotFound)
}
return
}
}
================================================
FILE: jaxrs-common/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jaxrs-common</artifactId>
<dependencies>
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
<version>1.0.0.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
================================================
FILE: jaxrs-common/src/main/java/com/colobu/rest/jaxrs/HelloResource.java
================================================
package com.colobu.rest.jaxrs;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/rest/hello")
public class HelloResource {
public HelloResource() {
System.out.println("HelloResource()");
}
@GET
@Produces(MediaType.TEXT_PLAIN)
public String helloAsync() {
return "Hello world";
}
}
================================================
FILE: jaxrs-common/src/main/java/com/colobu/rest/jaxrs/HelloResourceAsync.java
================================================
package com.colobu.rest.jaxrs;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.container.AsyncResponse;
import javax.ws.rs.container.Suspended;
import javax.ws.rs.core.MediaType;
@Path("/rest/helloAsync")
public class HelloResourceAsync {
private ExecutorService executor = Executors
.newFixedThreadPool(Integer.getInteger("com.colobu.rest.jaxrs.concurrency", 16));
public HelloResourceAsync() {
System.out.println("HelloResourceAsync()");
}
@GET
@Produces(MediaType.TEXT_PLAIN)
public void helloAsync(@Suspended final AsyncResponse response) {
executor.execute(() -> {
response.resume("Hello world");
});
}
}
================================================
FILE: jaxrs-common/src/main/java/com/colobu/rest/jaxrs/MyApplication.java
================================================
package com.colobu.rest.jaxrs;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath("")
public class MyApplication extends Application {
@Override
public Set<Class<?>> getClasses() {
return Collections.emptySet();
}
@Override
public Set<Object> getSingletons() {
HashSet<Object> classes = new HashSet<>();
classes.add(new HelloResource());
classes.add(new HelloResourceAsync());
return classes;
}
}
================================================
FILE: jersey-grizzly2/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jersey-grizzly2</artifactId>
<dependencies>
<dependency>
<artifactId>jaxrs-common</artifactId>
<groupId>com.colobu</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-http</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.rest.jerseygrizzly2.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.jerseygrizzly2.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: jersey-grizzly2/src/main/java/com/colobu/rest/jerseygrizzly2/Main.java
================================================
package com.colobu.rest.jerseygrizzly2;
import java.io.IOException;
import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.server.ResourceConfig;
import com.colobu.rest.jaxrs.MyApplication;
public class Main {
public static final String BASE_URI = "http://localhost:8080/";
public static HttpServer startServer(String host, int port) {
final ResourceConfig rc = ResourceConfig.forApplicationClass(MyApplication.class);
URI baseUri = UriBuilder.fromUri(BASE_URI).host(host).port(port).build();
return GrizzlyHttpServerFactory.createHttpServer(baseUri, rc);
}
public static void main(String[] args) throws IOException {
String host = "0.0.0.0";
int port = 8080;
if (args.length > 0) {
host = args[0];
}
if (args.length > 1) {
port = Integer.parseInt(args[1]);
}
final HttpServer server = startServer(host,port);
System.in.read();
server.shutdown();
}
}
================================================
FILE: jersey-jetty/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jersey-jetty</artifactId>
<dependencies>
<dependency>
<artifactId>jaxrs-common</artifactId>
<groupId>com.colobu</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-jetty-http</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.rest.jerseyjetty.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.jerseyjetty.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: jersey-jetty/src/main/java/com/colobu/rest/jerseyjetty/Main.java
================================================
package com.colobu.rest.jerseyjetty;
import org.eclipse.jetty.server.Server;
import org.glassfish.jersey.jetty.JettyHttpContainerFactory;
import org.glassfish.jersey.server.ResourceConfig;
import com.colobu.rest.jaxrs.MyApplication;
import javax.ws.rs.core.UriBuilder;
import java.net.URI;
public class Main {
public static final String BASE_URI = "http://localhost:8080";
public static Server startServer(String host, int port) {
final ResourceConfig rc = ResourceConfig.forApplicationClass(MyApplication.class);
URI baseUri = UriBuilder.fromUri(BASE_URI).host(host).port(port).build();
return JettyHttpContainerFactory.createServer(baseUri, rc);
}
public static void main(String[] args) throws Exception {
String host = "0.0.0.0";
int port = 8080;
if (args.length > 0) {
host = args[0];
}
if (args.length > 1) {
port = Integer.parseInt(args[1]);
}
final Server server = startServer(host, port);
System.in.read();
server.stop();
}
}
================================================
FILE: light-java/pom.xml
================================================
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>swagger-light-java</artifactId>
<packaging>jar</packaging>
<name>swagger-light-java</name>
<version>1.0.0</version>
<prerequisites>
<maven>2.2.0</maven>
</prerequisites>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.framework>1.1.0</version.framework>
<version.jackson>2.12.6.1</version.jackson>
<version.slf4j>1.7.21</version.slf4j>
<version.jose4j>0.5.2</version.jose4j>
<version.antlr4>4.5.3</version.antlr4>
<version.commons-lang>2.6</version.commons-lang>
<version.commons.io>2.5</version.commons.io>
<version.commons.codec>1.10</version.commons.codec>
<version.encoder>1.2</version.encoder>
<version.metrics>3.1.2</version.metrics>
<version.logback>1.2.0</version.logback>
<version.junit>4.13.1</version.junit>
<version.mockito>2.1.0-beta.124</version.mockito>
<version.undertow>2.2.24.Final</version.undertow>
<version.jsonpath>2.2.0</version.jsonpath>
<version.httpclient>4.5.13</version.httpclient>
<version.httpasyncclient>4.1.2</version.httpasyncclient>
<version.swagger>1.5.10</version.swagger>
</properties>
<dependencies>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>config</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>utility</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>security</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>client</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>audit</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>info</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>validator</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>status</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>exception</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>body</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>mask</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>swagger</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>metrics</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>handler</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>server</artifactId>
<version>${version.framework}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${version.jackson}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${version.jackson}</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${version.jsonpath}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${version.logback}</version>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
<version>${version.undertow}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${version.swagger}</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${version.httpclient}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<directory>target</directory>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<mainClass>com.networknt.server.Server</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument>
<argument>target/${project.build.finalName}.jar</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
================================================
FILE: light-java/src/main/java/Example.java
================================================
import com.networknt.server.HandlerProvider;
import io.undertow.Handlers;
import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
public class Example implements HandlerProvider {
public HttpHandler getHandler() {
return Handlers.path()
.addPrefixPath("/rest/hello", new HttpHandler() {
public void handleRequest(HttpServerExchange exchange) {
exchange.getResponseSender().send("Hello World");
}
}
);
}
}
================================================
FILE: light-java/src/main/resources/META-INF/services/com.networknt.server.HandlerProvider
================================================
Example
================================================
FILE: light-java/src/main/resources/logback.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2016 Network New Technologies Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ You may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<configuration>
TODO create logger for audit only.
http://stackoverflow.com/questions/2488558/logback-to-log-different-messages-to-two-files
<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Marker>PROFILER</Marker>
<!--<OnMatch>DENY</OnMatch>-->
<OnMatch>NEUTRAL</OnMatch>
</turboFilter>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5marker %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="log" class="ch.qos.logback.core.FileAppender">
<File>target/test.log</File>
<Append>false</Append>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %class{36}:%L %M - %msg%n</Pattern>
</layout>
</appender>
<!--audit log-->
<appender name="audit" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>target/audit.log</file> <!-- logfile location -->
<encoder>
<pattern>%-5level [%thread] %date{ISO8601} %F:%L - %msg%n
</pattern> <!-- the layout pattern used to format log entries -->
<immediateFlush>true</immediateFlush>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>target/audit.log.%i.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>5</maxIndex> <!-- max number of archived logs that are kept -->
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>200MB
</maxFileSize> <!-- The size of the logfile that triggers a switch to a new logfile, and the current one archived -->
</triggeringPolicy>
</appender>
<root level="error">
<appender-ref ref="stdout"/>
</root>
<logger name="com.networknt" level="error">
<appender-ref ref="log"/>
</logger>
<logger name="Audit" level="error" additivity="false">
<appender-ref ref="audit"/>
</logger>
</configuration>
================================================
FILE: nativenetty/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>nativenetty</artifactId>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.rest.nativenetty.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.nativenetty.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: nativenetty/src/main/java/com/colobu/rest/nativenetty/HelloWorldHandler.java
================================================
package com.colobu.rest.nativenetty;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.http.*;
import io.netty.util.AsciiString;
import static io.netty.handler.codec.http.HttpResponseStatus.*;
import static io.netty.handler.codec.http.HttpVersion.*;
public class HelloWorldHandler extends ChannelInboundHandlerAdapter {
private static final byte[] CONTENT = { 'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd' };
private static final AsciiString CONTENT_TYPE = new AsciiString("Content-Type");
private static final AsciiString CONTENT_LENGTH = new AsciiString("Content-Length");
private static final AsciiString CONNECTION = new AsciiString("Connection");
private static final AsciiString KEEP_ALIVE = new AsciiString("keep-alive");
@Override
public void channelReadComplete(ChannelHandlerContext ctx) {
ctx.flush();
}
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
if (msg instanceof HttpRequest) {
HttpRequest req = (HttpRequest) msg;
if (HttpUtil.is100ContinueExpected(req)) {
ctx.write(new DefaultFullHttpResponse(HTTP_1_1, CONTINUE));
}
boolean keepAlive = HttpUtil.isKeepAlive(req);
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, OK, Unpooled.wrappedBuffer(CONTENT));
if (req.method() == HttpMethod.GET) {
response.headers().set(CONTENT_TYPE, "text/plain");
response.headers().setInt(CONTENT_LENGTH, response.content().readableBytes());
}
if (!keepAlive) {
ctx.write(response).addListener(ChannelFutureListener.CLOSE);
} else {
response.headers().set(CONNECTION, KEEP_ALIVE);
ctx.write(response);
}
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
cause.printStackTrace();
ctx.close();
}
}
================================================
FILE: nativenetty/src/main/java/com/colobu/rest/nativenetty/Main.java
================================================
package com.colobu.rest.nativenetty;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;
public class Main {
public static void main(String[] args) throws Exception {
String host = "0.0.0.0";
int port = 8080;
if (args.length > 0) {
host = args[0];
}
if (args.length > 1) {
port = Integer.parseInt(args[1]);
}
EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
ServerBootstrap b = new ServerBootstrap();
b.option(ChannelOption.SO_BACKLOG, 1024);
b.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
//.handler(new LoggingHandler(LogLevel.INFO))
.childHandler(new ChannelInitializer<SocketChannel>(){
@Override
protected void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline p = ch.pipeline();
p.addLast(new HttpServerCodec());
p.addLast(new HelloWorldHandler());
}
});
Channel ch = b.bind(host,port).sync().channel();
ch.closeFuture().sync();
} finally {
bossGroup.shutdownGracefully();
workerGroup.shutdownGracefully();
}
}
}
================================================
FILE: node.js/install.sh
================================================
npm install restify
================================================
FILE: node.js/server.js
================================================
var restify = require('restify');
function respond(req, res, next) {
res.send('hello world');
next();
}
var server = restify.createServer();
server.get('/hello', respond);
server.listen(8080, function() {
console.log('%s listening at %s', server.name, server.url);
});
================================================
FILE: pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.colobu</groupId>
<artifactId>restful-services</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<resteasy.version>3.5.1.Final</resteasy.version>
<jersey.version>2.27</jersey.version>
<springboot.version>2.0.2.RELEASE</springboot.version>
<vertx.version>3.5.1</vertx.version>
<undertow.version>2.0.1.Final</undertow.version>
<netty.version>4.1.25.Final</netty.version>
<jetty.version>9.4.10.v20180503</jetty.version>
<dropwizard.version>1.2.4</dropwizard.version>
<async-http-servlet.version>3.0.19.Final</async-http-servlet.version>
<wildfly.version>13.0.0.Final</wildfly.version>
<java.version>1.8</java.version>
<grizzly.version>2.4.3</grizzly.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>jaxrs-common</module>
<module>jersey-jetty</module>
<module>jersey-grizzly2</module>
<module>resteasy-undertow</module>
<module>resteasy-netty</module>
<module>dropwizard</module>
<module>springboot</module>
<module>springboot-undertow</module>
<module>nativenetty</module>
<module>resteasy-netty4</module>
<module>resteasy-jetty</module>
<!-- <module>resteasy-wildfly</module> -->
<!-- <module>resteasy-grizzly</module> -->
<module>vertx</module>
<module>vertx-verticles</module>
<!--<module>armeria</module>-->
<module>act</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
</plugins>
</pluginManagement>
</build>
</project>
================================================
FILE: resteasy-jetty/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>resteasy-jetty</artifactId>
<dependencies>
<dependency>
<artifactId>jaxrs-common</artifactId>
<groupId>com.colobu</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>async-http-servlet-3.0</artifactId>
<version>${async-http-servlet.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-servlet-initializer</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.rest.resteasyjetty.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.resteasyjetty.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: resteasy-jetty/src/main/java/com/colobu/rest/resteasyjetty/Main.java
================================================
package com.colobu.rest.resteasyjetty;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher;
public class Main {
static final String CONTEXT_ROOT = "/";
String host = "0.0.0.0";
int port = 8080;
public Main(String host, int port) {
this.host = host;
this.port = port;
}
public void run() throws Exception {
final Server server = new Server(port);
// Setup the basic Application "context" at "/".
// This is also known as the handler tree (in Jetty speak).
final ServletContextHandler context = new ServletContextHandler(server, CONTEXT_ROOT);
// Setup RESTEasy's HttpServletDispatcher at "/api/*".
final ServletHolder restEasyServlet = new ServletHolder(new HttpServletDispatcher());
restEasyServlet.setInitParameter("resteasy.servlet.mapping.prefix", "/");
restEasyServlet.setInitParameter("javax.ws.rs.Application", "com.colobu.rest.jaxrs.MyApplication");
context.addServlet(restEasyServlet, "/rest/*");
// Setup the DefaultServlet at "/".
final ServletHolder defaultServlet = new ServletHolder(new DefaultServlet());
context.addServlet(defaultServlet, CONTEXT_ROOT);
server.setHandler(context);
server.start();
server.join();
}
public static void main(String[] args) throws Exception {
String host = "0.0.0.0";
int port = 8080;
if (args.length > 0) {
host = args[0];
}
if (args.length > 1) {
port = Integer.parseInt(args[1]);
}
try {
new Main(host, port).run();
} catch (Throwable t) {
t.printStackTrace();
}
}
}
================================================
FILE: resteasy-netty/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>resteasy-netty</artifactId>
<dependencies>
<dependency>
<artifactId>jaxrs-common</artifactId>
<groupId>com.colobu</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>async-http-servlet-3.0</artifactId>
<version>${async-http-servlet.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-netty</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.rest.resteasynetty.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.resteasynetty.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: resteasy-netty/src/main/java/com/colobu/rest/resteasynetty/Main.java
================================================
package com.colobu.rest.resteasynetty;
import org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer;
import org.jboss.resteasy.spi.ResteasyDeployment;
import com.colobu.rest.jaxrs.MyApplication;
public class Main {
public static void main(String[] args) throws Exception {
String host = "0.0.0.0";
int port = 8080;
if (args.length > 0) {
host = args[0];
}
if (args.length > 1) {
port = Integer.parseInt(args[1]);
}
NettyJaxrsServer netty = new NettyJaxrsServer();
ResteasyDeployment deployment = new ResteasyDeployment();
deployment.setApplication(new MyApplication());
netty.setDeployment(deployment);
netty.setHostname(host);
netty.setPort(port);
netty.setRootResourcePath("/");
netty.setSecurityDomain(null);
netty.start();
}
}
================================================
FILE: resteasy-netty4/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>resteasy-netty4</artifactId>
<dependencies>
<dependency>
<artifactId>jaxrs-common</artifactId>
<groupId>com.colobu</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>async-http-servlet-3.0</artifactId>
<version>${async-http-servlet.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-netty4</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.rest.resteasynetty4.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.resteasynetty4.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: resteasy-netty4/src/main/java/com/colobu/rest/resteasynetty4/Main.java
================================================
package com.colobu.rest.resteasynetty4;
import org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer;
import org.jboss.resteasy.spi.ResteasyDeployment;
import com.colobu.rest.jaxrs.MyApplication;
public class Main {
public static void main(String[] args) throws Exception {
String host = "0.0.0.0";
int port = 8080;
if (args.length > 0) {
host = args[0];
}
if (args.length > 1) {
port = Integer.parseInt(args[1]);
}
NettyJaxrsServer netty = new NettyJaxrsServer();
ResteasyDeployment deployment = new ResteasyDeployment();
deployment.setApplication(new MyApplication());
netty.setDeployment(deployment);
netty.setHostname(host);
netty.setPort(port);
netty.setRootResourcePath("/");
netty.setSecurityDomain(null);
netty.start();
}
}
================================================
FILE: resteasy-undertow/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>resteasy-undertow</artifactId>
<dependencies>
<dependency>
<artifactId>jaxrs-common</artifactId>
<groupId>com.colobu</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>async-http-servlet-3.0</artifactId>
<version>${async-http-servlet.version}</version>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-servlet</artifactId>
<version>${undertow.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-undertow</artifactId>
<version>${resteasy.version}</version>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
<version>${undertow.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.rest.resteasyundertow.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.resteasyundertow.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: resteasy-undertow/src/main/java/com/colobu/rest/resteasyundertow/Main.java
================================================
package com.colobu.rest.resteasyundertow;
import org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer;
import com.colobu.rest.jaxrs.MyApplication;
import io.undertow.Undertow;
public class Main {
private static UndertowJaxrsServer server;
public static void main(String[] args) throws Exception {
String host = "0.0.0.0";
int port = 8080;
if (args.length > 0) {
host = args[0];
}
if (args.length > 1) {
port = Integer.parseInt(args[1]);
}
Undertow.Builder builder = Undertow.builder().addHttpListener(port, host);
server = new UndertowJaxrsServer().start(builder);
server.deploy(MyApplication.class, "/");
// DeploymentInfo di = server.undertowDeployment(MyApplication.class);
// di.setContextPath("/rest");
// di.setDeploymentName("rest");
// server.deploy(di);
}
}
================================================
FILE: springboot/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>springboot</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${springboot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.springboot.Main</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.springboot.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: springboot/src/main/java/com/colobu/rest/springboot/HelloController.java
================================================
package com.colobu.rest.springboot;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@EnableAutoConfiguration
public class HelloController {
@RequestMapping("/rest/hello")
@ResponseBody
String hello() {
return "Hello World";
}
@RequestMapping("/rest/helloAsync")
@ResponseBody
@Async
String helloAsync() {
return "Hello World";
}
}
================================================
FILE: springboot/src/main/java/com/colobu/rest/springboot/Main.java
================================================
package com.colobu.rest.springboot;
import org.springframework.boot.SpringApplication;
public class Main {
public static void main(String[] args) throws Exception {
SpringApplication.run(HelloController.class, args);
}
}
================================================
FILE: springboot/src/main/resources/application.properties
================================================
server.address=0.0.0.0
server.port = 8080
================================================
FILE: springboot-undertow/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>springboot-undertow</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${springboot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${springboot.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.springboot.Main</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.springboot.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: springboot-undertow/src/main/java/com/colobu/rest/springboot/HelloController.java
================================================
package com.colobu.rest.springboot;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@EnableAutoConfiguration
public class HelloController {
@RequestMapping("/rest/hello")
@ResponseBody
String hello() {
return "Hello World";
}
@RequestMapping("/rest/helloAsync")
@ResponseBody
@Async
String helloAsync() {
return "Hello World";
}
}
================================================
FILE: springboot-undertow/src/main/java/com/colobu/rest/springboot/Main.java
================================================
package com.colobu.rest.springboot;
import org.springframework.boot.SpringApplication;
public class Main {
public static void main(String[] args) throws Exception {
SpringApplication.run(HelloController.class, args);
}
}
================================================
FILE: springboot-undertow/src/main/resources/application.properties
================================================
server.address=0.0.0.0
server.port = 8080
================================================
FILE: vertx/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>vertx</artifactId>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.colobu.rest.vertx.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.vertx.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: vertx/src/main/java/com/colobu/rest/vertx/Main.java
================================================
package com.colobu.rest.vertx;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;
import io.vertx.ext.web.handler.BodyHandler;
public class Main {
public static void main(String[] args) {
VertxOptions options = new VertxOptions();
Vertx vertx = Vertx.vertx(options);
Router router = Router.router(vertx);
router.route().handler(BodyHandler.create());
router.get("/rest/hello").handler(Main::handleHello);
vertx.createHttpServer().requestHandler(router::accept).listen(8080);
}
private static void handleHello(RoutingContext routingContext) {
HttpServerResponse response = routingContext.response();
response.putHeader("content-type", "application/json").end("Hello world");
}
}
================================================
FILE: vertx-verticles/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>restful-services</artifactId>
<groupId>com.colobu</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>vertx-verticles</artifactId>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>io.vertx.core.Starter</Main-Class>
<Main-Verticle>com.colobu.rest.vertx.Main</Main-Verticle>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
</transformer>
</transformers>
<artifactSet>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.colobu.rest.vertx.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: vertx-verticles/src/main/java/com/colobu/rest/vertx/Main.java
================================================
package com.colobu.rest.vertx;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;
import io.vertx.ext.web.handler.BodyHandler;
public class Main extends AbstractVerticle {
// public static void main(String[] args) {
// Vertx vertx = Vertx.vertx();
// vertx.deployVerticle(Main.class.getName(),new DeploymentOptions().setInstances(20), e -> {
// System.out.println(e.succeeded());
// System.out.println(e.failed());
// System.out.println(e.cause());
// System.out.println(e.result());
// });
// //vertx.deployVerticle(Main.class.getName(),new DeploymentOptions().setInstances(2 * Runtime.getRuntime().availableProcessors()));
//
// }
@Override
public void start() {
Router router = Router.router(vertx);
router.route().handler(BodyHandler.create());
router.get("/rest/hello").handler(Main::handleHello);
vertx.createHttpServer().requestHandler(router::accept).listen(8080);
}
private static void handleHello(RoutingContext routingContext) {
HttpServerResponse response = routingContext.response();
response.putHeader("content-type", "application/json").end("Hello world");
}
}
gitextract_5f2xv914/
├── .gitignore
├── LICENSE
├── README.md
├── TestData.md
├── act/
│ ├── .gitignore
│ ├── README.md
│ ├── pom.xml
│ ├── run_dev
│ ├── run_dev.bat
│ ├── run_e2e
│ ├── run_e2e.bat
│ ├── run_prod
│ └── src/
│ └── main/
│ ├── java/
│ │ └── benchmark/
│ │ └── act/
│ │ └── AppEntry.java
│ └── resources/
│ ├── benchmark/
│ │ └── act/
│ │ └── .version
│ ├── conf/
│ │ ├── app.properties
│ │ ├── prod/
│ │ │ └── app.properties
│ │ └── uat/
│ │ └── app.properties
│ ├── e2e/
│ │ └── scenarios.yml
│ ├── logback.xml
│ └── routes.conf
├── armeria/
│ ├── pom.xml
│ └── src/
│ └── main/
│ ├── java/
│ │ └── com/
│ │ └── colobu/
│ │ └── armeria/
│ │ └── Main.java
│ └── thrift/
│ └── v1/
│ └── main.thrift
├── dropwizard/
│ ├── hello.yml
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── dropwizard/
│ ├── Main.java
│ ├── MyApplication.java
│ ├── MyConfiguration.java
│ └── MyHealthCheck.java
├── go/
│ └── main.go
├── go-fasthttp/
│ └── main.go
├── jaxrs-common/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── jaxrs/
│ ├── HelloResource.java
│ ├── HelloResourceAsync.java
│ └── MyApplication.java
├── jersey-grizzly2/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── jerseygrizzly2/
│ └── Main.java
├── jersey-jetty/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── jerseyjetty/
│ └── Main.java
├── light-java/
│ ├── pom.xml
│ └── src/
│ └── main/
│ ├── java/
│ │ └── Example.java
│ └── resources/
│ ├── META-INF/
│ │ └── services/
│ │ └── com.networknt.server.HandlerProvider
│ └── logback.xml
├── nativenetty/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── nativenetty/
│ ├── HelloWorldHandler.java
│ └── Main.java
├── node.js/
│ ├── install.sh
│ └── server.js
├── pom.xml
├── resteasy-jetty/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── resteasyjetty/
│ └── Main.java
├── resteasy-netty/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── resteasynetty/
│ └── Main.java
├── resteasy-netty4/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── resteasynetty4/
│ └── Main.java
├── resteasy-undertow/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── resteasyundertow/
│ └── Main.java
├── springboot/
│ ├── pom.xml
│ └── src/
│ └── main/
│ ├── java/
│ │ └── com/
│ │ └── colobu/
│ │ └── rest/
│ │ └── springboot/
│ │ ├── HelloController.java
│ │ └── Main.java
│ └── resources/
│ └── application.properties
├── springboot-undertow/
│ ├── pom.xml
│ └── src/
│ └── main/
│ ├── java/
│ │ └── com/
│ │ └── colobu/
│ │ └── rest/
│ │ └── springboot/
│ │ ├── HelloController.java
│ │ └── Main.java
│ └── resources/
│ └── application.properties
├── testdata.xlsx
├── vertx/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── colobu/
│ └── rest/
│ └── vertx/
│ └── Main.java
└── vertx-verticles/
├── pom.xml
└── src/
└── main/
└── java/
└── com/
└── colobu/
└── rest/
└── vertx/
└── Main.java
SYMBOL INDEX (66 symbols across 27 files)
FILE: act/src/main/java/benchmark/act/AppEntry.java
class AppEntry (line 12) | @SuppressWarnings("unused")
method main (line 15) | public static void main(String[] args) throws Exception {
FILE: armeria/src/main/java/com/colobu/armeria/Main.java
class Main (line 13) | public class Main {
method main (line 14) | public static void main(String[] args) {
FILE: dropwizard/src/main/java/com/colobu/rest/dropwizard/Main.java
class Main (line 4) | public class Main {
method main (line 5) | public static void main(String[] args) throws Exception {
FILE: dropwizard/src/main/java/com/colobu/rest/dropwizard/MyApplication.java
class MyApplication (line 10) | public class MyApplication extends Application<MyConfiguration> {
method getName (line 12) | @Override
method initialize (line 17) | @Override
method run (line 22) | @Override
FILE: dropwizard/src/main/java/com/colobu/rest/dropwizard/MyConfiguration.java
class MyConfiguration (line 7) | public class MyConfiguration extends Configuration {
FILE: dropwizard/src/main/java/com/colobu/rest/dropwizard/MyHealthCheck.java
class MyHealthCheck (line 5) | public class MyHealthCheck extends HealthCheck {
method check (line 6) | @Override
FILE: go-fasthttp/main.go
function main (line 9) | func main() {
function fastHTTPHandler (line 16) | func fastHTTPHandler(ctx *fasthttp.RequestCtx) {
FILE: go/main.go
function main (line 9) | func main() {
FILE: jaxrs-common/src/main/java/com/colobu/rest/jaxrs/HelloResource.java
class HelloResource (line 8) | @Path("/rest/hello")
method HelloResource (line 10) | public HelloResource() {
method helloAsync (line 14) | @GET
FILE: jaxrs-common/src/main/java/com/colobu/rest/jaxrs/HelloResourceAsync.java
class HelloResourceAsync (line 13) | @Path("/rest/helloAsync")
method HelloResourceAsync (line 18) | public HelloResourceAsync() {
method helloAsync (line 22) | @GET
FILE: jaxrs-common/src/main/java/com/colobu/rest/jaxrs/MyApplication.java
class MyApplication (line 10) | @ApplicationPath("")
method getClasses (line 12) | @Override
method getSingletons (line 17) | @Override
FILE: jersey-grizzly2/src/main/java/com/colobu/rest/jerseygrizzly2/Main.java
class Main (line 15) | public class Main {
method startServer (line 18) | public static HttpServer startServer(String host, int port) {
method main (line 24) | public static void main(String[] args) throws IOException {
FILE: jersey-jetty/src/main/java/com/colobu/rest/jerseyjetty/Main.java
class Main (line 13) | public class Main {
method startServer (line 16) | public static Server startServer(String host, int port) {
method main (line 22) | public static void main(String[] args) throws Exception {
FILE: light-java/src/main/java/Example.java
class Example (line 7) | public class Example implements HandlerProvider {
method getHandler (line 9) | public HttpHandler getHandler() {
FILE: nativenetty/src/main/java/com/colobu/rest/nativenetty/HelloWorldHandler.java
class HelloWorldHandler (line 13) | public class HelloWorldHandler extends ChannelInboundHandlerAdapter {
method channelReadComplete (line 21) | @Override
method channelRead (line 26) | @Override
method exceptionCaught (line 50) | @Override
FILE: nativenetty/src/main/java/com/colobu/rest/nativenetty/Main.java
class Main (line 10) | public class Main {
method main (line 11) | public static void main(String[] args) throws Exception {
FILE: node.js/server.js
function respond (line 3) | function respond(req, res, next) {
FILE: resteasy-jetty/src/main/java/com/colobu/rest/resteasyjetty/Main.java
class Main (line 10) | public class Main {
method Main (line 15) | public Main(String host, int port) {
method run (line 20) | public void run() throws Exception {
method main (line 41) | public static void main(String[] args) throws Exception {
FILE: resteasy-netty/src/main/java/com/colobu/rest/resteasynetty/Main.java
class Main (line 9) | public class Main {
method main (line 10) | public static void main(String[] args) throws Exception {
FILE: resteasy-netty4/src/main/java/com/colobu/rest/resteasynetty4/Main.java
class Main (line 9) | public class Main {
method main (line 10) | public static void main(String[] args) throws Exception {
FILE: resteasy-undertow/src/main/java/com/colobu/rest/resteasyundertow/Main.java
class Main (line 10) | public class Main {
method main (line 13) | public static void main(String[] args) throws Exception {
FILE: springboot-undertow/src/main/java/com/colobu/rest/springboot/HelloController.java
class HelloController (line 9) | @RestController
method hello (line 13) | @RequestMapping("/rest/hello")
method helloAsync (line 19) | @RequestMapping("/rest/helloAsync")
FILE: springboot-undertow/src/main/java/com/colobu/rest/springboot/Main.java
class Main (line 6) | public class Main {
method main (line 7) | public static void main(String[] args) throws Exception {
FILE: springboot/src/main/java/com/colobu/rest/springboot/HelloController.java
class HelloController (line 9) | @RestController
method hello (line 13) | @RequestMapping("/rest/hello")
method helloAsync (line 19) | @RequestMapping("/rest/helloAsync")
FILE: springboot/src/main/java/com/colobu/rest/springboot/Main.java
class Main (line 6) | public class Main {
method main (line 7) | public static void main(String[] args) throws Exception {
FILE: vertx-verticles/src/main/java/com/colobu/rest/vertx/Main.java
class Main (line 10) | public class Main extends AbstractVerticle {
method start (line 22) | @Override
method handleHello (line 30) | private static void handleHello(RoutingContext routingContext) {
FILE: vertx/src/main/java/com/colobu/rest/vertx/Main.java
class Main (line 11) | public class Main {
method main (line 12) | public static void main(String[] args) {
method handleHello (line 22) | private static void handleHello(RoutingContext routingContext) {
Condensed preview — 70 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (160K chars).
[
{
"path": ".gitignore",
"chars": 331,
"preview": ".idea/\n.settings/\ntarget/\n*.iml\n*.log\n*.class\ndependency-reduced-pom.xml\n\n# mvn versions files\npom.xml.versionsBackup\n\n#"
},
{
"path": "LICENSE",
"chars": 11358,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 3533,
"preview": "# Jax-RS-Performance-Comparison\nPerformance Comparison of Jax-RS implementations and embedded containers\n\n[![Build Statu"
},
{
"path": "TestData.md",
"chars": 19099,
"preview": "### jersey-grizzly2\n```\n[smallnest@ip-xxx-xxx-xxx-xxx ~]# wrk -t16 -c100 -d30s http://127.0.0.1:8080/rest/hello \nRunning"
},
{
"path": "act/.gitignore",
"chars": 180,
"preview": "*.iml\ntarget\n.idea\nclasses\n*.log\n*.DS_Store\n*all.sql\ntmp/\n**/.act*\n**/.classpath\n**/.settings\n**/.project\n**/.settings/\n"
},
{
"path": "act/README.md",
"chars": 480,
"preview": "# Jax-RS-Performance-Comparison - ActFramework implementation\n\n[ActFramework](https://github.com/actframework/actframewo"
},
{
"path": "act/pom.xml",
"chars": 940,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns=\"ht"
},
{
"path": "act/run_dev",
"chars": 50,
"preview": "#!/bin/sh\necho building ...\nmvn -q compile act:run"
},
{
"path": "act/run_dev.bat",
"chars": 40,
"preview": "echo building ...\nmvn -q compile act:run"
},
{
"path": "act/run_e2e",
"chars": 50,
"preview": "#!/bin/sh\necho building ...\nmvn -q compile act:e2e"
},
{
"path": "act/run_e2e.bat",
"chars": 40,
"preview": "echo building ...\nmvn -q compile act:e2e"
},
{
"path": "act/run_prod",
"chars": 168,
"preview": "#!/bin/sh\nif [ ! -f target/dist/start ]; then\n echo building ...\n mvn -q clean package\n cd target/dist\n tar "
},
{
"path": "act/src/main/java/benchmark/act/AppEntry.java",
"chars": 369,
"preview": "package benchmark.act;\n\nimport act.Act;\n\n/**\n * A simple hello world service app entry\n *\n * Run this app, try to update"
},
{
"path": "act/src/main/resources/benchmark/act/.version",
"chars": 78,
"preview": "artifact=${project.artifactId}\nversion=${project.version}\nbuild=${buildNumber}"
},
{
"path": "act/src/main/resources/conf/app.properties",
"chars": 24398,
"preview": "##############################################\n# Application configuration\n# act-1.8.8-RC8\n#############################"
},
{
"path": "act/src/main/resources/conf/prod/app.properties",
"chars": 230,
"preview": "##############################################\n# Application configuration for prod profile\n# act-1.8.8-RC8\n############"
},
{
"path": "act/src/main/resources/conf/uat/app.properties",
"chars": 229,
"preview": "##############################################\n# Application configuration for uat profile\n# act-1.8.8-RC8\n#############"
},
{
"path": "act/src/main/resources/e2e/scenarios.yml",
"chars": 289,
"preview": "Scenario(REST Hello Service):\n description: a service says hello\n interactions:\n - description: send request to hel"
},
{
"path": "act/src/main/resources/logback.xml",
"chars": 4079,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration>\n\n <statusListener class=\"ch.qos.logback.core.status.NopStatusLis"
},
{
"path": "act/src/main/resources/routes.conf",
"chars": 33,
"preview": "GET /rest/hello echo:Hello world\n"
},
{
"path": "armeria/pom.xml",
"chars": 4821,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "armeria/src/main/java/com/colobu/armeria/Main.java",
"chars": 1138,
"preview": "package com.colobu.armeria;\n\nimport com.colobu.armeria.service.thrift.v1.HelloService;\nimport com.linecorp.armeria.commo"
},
{
"path": "armeria/src/main/thrift/v1/main.thrift",
"chars": 96,
"preview": "namespace java com.colobu.armeria.service.thrift.v1\n\nservice HelloService {\n string hello()\n}"
},
{
"path": "dropwizard/hello.yml",
"chars": 279,
"preview": "server:\n type: default\n rootPath: /rest/*\n applicationConnectors:\n - type: http\n bindHost: 0.0.0.0\n port"
},
{
"path": "dropwizard/pom.xml",
"chars": 4037,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "dropwizard/src/main/java/com/colobu/rest/dropwizard/Main.java",
"chars": 167,
"preview": "package com.colobu.rest.dropwizard;\n\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n"
},
{
"path": "dropwizard/src/main/java/com/colobu/rest/dropwizard/MyApplication.java",
"chars": 827,
"preview": "package com.colobu.rest.dropwizard;\n\nimport com.colobu.rest.jaxrs.HelloResource;\nimport com.colobu.rest.jaxrs.HelloResou"
},
{
"path": "dropwizard/src/main/java/com/colobu/rest/dropwizard/MyConfiguration.java",
"chars": 165,
"preview": "package com.colobu.rest.dropwizard;\n\n\nimport io.dropwizard.Configuration;\n\n// add configuration if necessary.\npublic cla"
},
{
"path": "dropwizard/src/main/java/com/colobu/rest/dropwizard/MyHealthCheck.java",
"chars": 264,
"preview": "package com.colobu.rest.dropwizard;\n\nimport com.codahale.metrics.health.HealthCheck;\n\npublic class MyHealthCheck extends"
},
{
"path": "go/main.go",
"chars": 370,
"preview": "package main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n)\n\n// There are some golang RESTful libraries and mux libraries but i use the "
},
{
"path": "go-fasthttp/main.go",
"chars": 457,
"preview": "package main\n\nimport (\n\t\"log\"\n\n\t\"github.com/valyala/fasthttp\"\n)\n\nfunc main() {\n\terr := fasthttp.ListenAndServe(\":8080\", "
},
{
"path": "jaxrs-common/pom.xml",
"chars": 838,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "jaxrs-common/src/main/java/com/colobu/rest/jaxrs/HelloResource.java",
"chars": 400,
"preview": "package com.colobu.rest.jaxrs;\n\nimport javax.ws.rs.GET;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.Produces;\nimport jav"
},
{
"path": "jaxrs-common/src/main/java/com/colobu/rest/jaxrs/HelloResourceAsync.java",
"chars": 825,
"preview": "package com.colobu.rest.jaxrs;\n\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\n\nimp"
},
{
"path": "jaxrs-common/src/main/java/com/colobu/rest/jaxrs/MyApplication.java",
"chars": 583,
"preview": "package com.colobu.rest.jaxrs;\n\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.Set;\n\nimport ja"
},
{
"path": "jersey-grizzly2/pom.xml",
"chars": 2582,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n\txmlns:xsi=\"http://www.w3.org/"
},
{
"path": "jersey-grizzly2/src/main/java/com/colobu/rest/jerseygrizzly2/Main.java",
"chars": 1158,
"preview": "package com.colobu.rest.jerseygrizzly2;\n\nimport java.io.IOException;\nimport java.net.URI;\n\nimport javax.ws.rs.core.UriBu"
},
{
"path": "jersey-jetty/pom.xml",
"chars": 2911,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n\txmlns:xsi=\"http://www.w3.org/"
},
{
"path": "jersey-jetty/src/main/java/com/colobu/rest/jerseyjetty/Main.java",
"chars": 1083,
"preview": "package com.colobu.rest.jerseyjetty;\n\nimport org.eclipse.jetty.server.Server;\nimport org.glassfish.jersey.jetty.JettyHtt"
},
{
"path": "light-java/pom.xml",
"chars": 8847,
"preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocat"
},
{
"path": "light-java/src/main/java/Example.java",
"chars": 530,
"preview": "import com.networknt.server.HandlerProvider;\nimport io.undertow.Handlers;\nimport io.undertow.server.HttpHandler;\nimport "
},
{
"path": "light-java/src/main/resources/META-INF/services/com.networknt.server.HandlerProvider",
"chars": 7,
"preview": "Example"
},
{
"path": "light-java/src/main/resources/logback.xml",
"chars": 3068,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!--\r\n ~ Copyright (c) 2016 Network New Technologies Inc.\r\n ~\r\n ~ Licensed un"
},
{
"path": "nativenetty/pom.xml",
"chars": 3339,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "nativenetty/src/main/java/com/colobu/rest/nativenetty/HelloWorldHandler.java",
"chars": 2168,
"preview": "package com.colobu.rest.nativenetty;\n\nimport io.netty.buffer.Unpooled;\nimport io.netty.channel.ChannelFutureListener;\nim"
},
{
"path": "nativenetty/src/main/java/com/colobu/rest/nativenetty/Main.java",
"chars": 1689,
"preview": "package com.colobu.rest.nativenetty;\n\nimport io.netty.bootstrap.ServerBootstrap;\nimport io.netty.channel.*;\nimport io.ne"
},
{
"path": "node.js/install.sh",
"chars": 19,
"preview": "npm install restify"
},
{
"path": "node.js/server.js",
"chars": 278,
"preview": "var restify = require('restify');\n\nfunction respond(req, res, next) {\n res.send('hello world');\n next();\n}\n\nvar server"
},
{
"path": "pom.xml",
"chars": 2535,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
},
{
"path": "resteasy-jetty/pom.xml",
"chars": 3432,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n\txmlns:xsi=\"http://www.w3.org/"
},
{
"path": "resteasy-jetty/src/main/java/com/colobu/rest/resteasyjetty/Main.java",
"chars": 1711,
"preview": "package com.colobu.rest.resteasyjetty;\n\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.servlet.Default"
},
{
"path": "resteasy-netty/pom.xml",
"chars": 3959,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "resteasy-netty/src/main/java/com/colobu/rest/resteasynetty/Main.java",
"chars": 892,
"preview": "package com.colobu.rest.resteasynetty;\n\n\nimport org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer;\nimport org.jbo"
},
{
"path": "resteasy-netty4/pom.xml",
"chars": 4144,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "resteasy-netty4/src/main/java/com/colobu/rest/resteasynetty4/Main.java",
"chars": 893,
"preview": "package com.colobu.rest.resteasynetty4;\n\n\nimport org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer;\nimport org.jb"
},
{
"path": "resteasy-undertow/pom.xml",
"chars": 4350,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "resteasy-undertow/src/main/java/com/colobu/rest/resteasyundertow/Main.java",
"chars": 922,
"preview": "package com.colobu.rest.resteasyundertow;\n\n\nimport org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer;\n\nimpo"
},
{
"path": "springboot/pom.xml",
"chars": 2647,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "springboot/src/main/java/com/colobu/rest/springboot/HelloController.java",
"chars": 669,
"preview": "package com.colobu.rest.springboot;\n\nimport org.springframework.boot.autoconfigure.EnableAutoConfiguration;\nimport org.s"
},
{
"path": "springboot/src/main/java/com/colobu/rest/springboot/Main.java",
"chars": 240,
"preview": "package com.colobu.rest.springboot;\n\n\nimport org.springframework.boot.SpringApplication;\n\npublic class Main {\n public"
},
{
"path": "springboot/src/main/resources/application.properties",
"chars": 41,
"preview": "server.address=0.0.0.0\nserver.port = 8080"
},
{
"path": "springboot-undertow/pom.xml",
"chars": 3118,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "springboot-undertow/src/main/java/com/colobu/rest/springboot/HelloController.java",
"chars": 668,
"preview": "package com.colobu.rest.springboot;\n\nimport org.springframework.boot.autoconfigure.EnableAutoConfiguration;\nimport org.s"
},
{
"path": "springboot-undertow/src/main/java/com/colobu/rest/springboot/Main.java",
"chars": 240,
"preview": "package com.colobu.rest.springboot;\n\n\nimport org.springframework.boot.SpringApplication;\n\npublic class Main {\n public"
},
{
"path": "springboot-undertow/src/main/resources/application.properties",
"chars": 41,
"preview": "server.address=0.0.0.0\nserver.port = 8080"
},
{
"path": "vertx/pom.xml",
"chars": 3501,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "vertx/src/main/java/com/colobu/rest/vertx/Main.java",
"chars": 893,
"preview": "package com.colobu.rest.vertx;\n\n\nimport io.vertx.core.Vertx;\nimport io.vertx.core.VertxOptions;\nimport io.vertx.core.htt"
},
{
"path": "vertx-verticles/pom.xml",
"chars": 3872,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "vertx-verticles/src/main/java/com/colobu/rest/vertx/Main.java",
"chars": 1333,
"preview": "package com.colobu.rest.vertx;\n\n\nimport io.vertx.core.AbstractVerticle;\nimport io.vertx.core.http.HttpServerResponse;\nim"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the smallnest/Jax-RS-Performance-Comparison GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 70 files (145.5 KB), approximately 41.4k tokens, and a symbol index with 66 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.