forked from apache/cxf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CXF-9013: Move performance benchmark to distribution samples folder (a…
…pache#1867) * [CXF-9013] Add JAX-RS performance suite to benchmarks * [CXF-9013] Remove debugging print statements, add validation * [CXF-9013] Update README file * [CXF-9013] Move performance benchmark to distribution samples folder * [CXF-9013] add back in bin folders
- Loading branch information
Showing
65 changed files
with
879 additions
and
35 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
67 changes: 67 additions & 0 deletions
67
distribution/src/main/release/samples/performance/jaxrs/README.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
JAX-RS Basic With HTTPS communications Performance Suite | ||
========================================================= | ||
|
||
This sample takes the JAX-RS basic HTTPS demo a step further | ||
by integrating it with the performance test framework. | ||
|
||
The JAX-RS server is configured with a HTTPS listener. The listener | ||
requires client authentication so the client must provide suitable | ||
credentials. The listener configuration is taken from the | ||
"ServerConfig.xml" file located under demo directory. | ||
|
||
The client is configured to provide its certificate | ||
from its keystore "config/clientKeystore.jks" to the server. | ||
The server authenticates the client's certificate using its own | ||
keystore "config/serviceKeystore.jks", which contains the | ||
public cert of the client. The client makes HTTPS calls using | ||
CXF's WebClient object. | ||
|
||
Likewise the client authenticates the server's certificate "CN=localhost" | ||
using its keystore. Note also the usage of the cipherSuitesFilter | ||
configuration in the configuration files, where each party imposes | ||
different ciphersuites constraints, so that the ciphersuite eventually | ||
negotiated during the TLS handshake is acceptable to both sides. | ||
This may be viewed by adding a -Djavax.net.debug=all argument to the JVM. | ||
|
||
But please note that it is not advisable to store sensitive data such | ||
as passwords stored in a clear text configuration file, unless the | ||
file is sufficiently protected by OS level permissions. The KeyStores | ||
may be configured programmatically so using user interaction may be | ||
employed to keep passwords from being stored in configuration files. | ||
The approach taken here is for demonstration reasons only. | ||
|
||
Please review the README in the samples directory before | ||
continuing. | ||
|
||
|
||
Building and running the performance test case using Maven | ||
---------------------------------------------------------- | ||
From the base directory of this sample (i.e., where this README file is | ||
located), the Maven pom.xml file can be used to build and run the demo. | ||
|
||
|
||
Using either UNIX or Windows: | ||
|
||
cd base | ||
mvn install | ||
cd ../jaxrs | ||
mvn install | ||
mvn -Pserver (from one command line window) | ||
mvn -Pclient (from a second command line window) | ||
|
||
Alternatively, client and server may be executed from one window. | ||
|
||
mvn -Pclientserver [-Dthreads=N] [-Doperation=get] [-Dtime=M] | ||
|
||
To remove the target dir, run "mvn clean". | ||
|
||
The JAX-RS Client takes the following arguments: | ||
-Operation The rest verb to execute (get, post, put, delete) | ||
-Time define the amount of time to spend making invocations in seconds | ||
-Threads define the number of threads to run the performance client | ||
|
||
|
||
Certificates | ||
------------ | ||
See the src/main/config folder for the sample keys used (don't use | ||
these keys in production!) as well as scripts used for their creation. |
168 changes: 168 additions & 0 deletions
168
distribution/src/main/release/samples/performance/jaxrs/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you 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. | ||
--> | ||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.apache.cxf.samples</groupId> | ||
<artifactId>cxf-samples</artifactId> | ||
<version>4.1.0-SNAPSHOT</version> | ||
<relativePath>../..</relativePath> | ||
</parent> | ||
|
||
<artifactId>cxf-benchmark-jaxrs-basic-https</artifactId> | ||
<name>JAX-RS Basic With HTTPS communications</name> | ||
<description>Apache CXF Benchmark JAX-RS Basic HTTPS communications</description> | ||
<url>https://cxf.apache.org</url> | ||
|
||
<profiles> | ||
<profile> | ||
<id>server</id> | ||
<build> | ||
<defaultGoal>test</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
<configuration> | ||
<mainClass>org.apache.cxf.performance.https.server.Server</mainClass> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>client</id> | ||
<properties> | ||
<operation>get</operation> | ||
<threads>4</threads> | ||
<time>30</time> | ||
</properties> | ||
<build> | ||
<defaultGoal>test</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>${maven.exec.plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
<configuration> | ||
<mainClass>org.apache.cxf.performance.https.client.Client</mainClass> | ||
<arguments> | ||
<argument>-Operation</argument> | ||
<argument>${operation}</argument> | ||
<argument>-Threads</argument> | ||
<argument>${threads}</argument> | ||
<argument>-Amount</argument> | ||
<argument>${time}</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>clientserver</id> | ||
<properties> | ||
<operation>get</operation> | ||
<threads>4</threads> | ||
<time>30</time> | ||
</properties> | ||
<build> | ||
<defaultGoal>test</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
<configuration> | ||
<classpathScope>test</classpathScope> | ||
<mainClass>org.apache.cxf.performance.https.client.Client</mainClass> | ||
<arguments> | ||
<argument>-Operation</argument> | ||
<argument>${operation}</argument> | ||
<argument>-Threads</argument> | ||
<argument>${threads}</argument> | ||
<argument>-Amount</argument> | ||
<argument>${time}</argument> | ||
<argument>-Server</argument> | ||
<argument>-nowait</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.cxf.samples</groupId> | ||
<artifactId>cxf-benchmark-base</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cxf</groupId> | ||
<artifactId>cxf-rt-frontend-jaxrs</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cxf</groupId> | ||
<artifactId>cxf-rt-rs-client</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cxf</groupId> | ||
<artifactId>cxf-rt-transports-http-jetty</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>httpclient</artifactId> | ||
<version>${cxf.httpcomponents.client.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
19 changes: 19 additions & 0 deletions
19
distribution/src/main/release/samples/performance/jaxrs/src/main/config/KeyREADME.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# The below scripts show the commands used to generate the self-signed keys for this sample. | ||
# If you use the below script to create your own keys be sure to change the passwords used here | ||
# DO NOT USE THE SUPPLIED KEYS IN PRODUCTION--everyone has them!! | ||
# For production recommended to use keys signed by a third-party certificate authority (CA) | ||
|
||
# Create the combination keystore/truststore for the client and service. | ||
# Note you can create separate keystores/truststores for both if desired | ||
keytool -genkeypair -validity 730 -alias myservicekey -keystore serviceKeystore.jks -dname "cn=localhost" -keypass skpass -storepass sspass | ||
keytool -genkeypair -validity 730 -alias myclientkey -keystore clientKeystore.jks -keypass ckpass -storepass cspass | ||
|
||
# Place server public cert in client key/truststore | ||
keytool -export -rfc -keystore serviceKeystore.jks -alias myservicekey -file MyService.cer -storepass sspass | ||
keytool -import -noprompt -trustcacerts -file MyService.cer -alias myservicekey -keystore clientKeystore.jks -storepass cspass | ||
|
||
# Place client public cert in service key/truststore | ||
# Note this needs to be done only if you're requiring client authentication | ||
# as configured in resources/ServerConfig.xml | ||
keytool -export -rfc -keystore clientKeystore.jks -alias myclientkey -file MyClient.cer -storepass cspass | ||
keytool -import -noprompt -trustcacerts -file MyClient.cer -alias myclientkey -keystore serviceKeystore.jks -storepass sspass |
Binary file added
BIN
+1.99 KB
distribution/src/main/release/samples/performance/jaxrs/src/main/config/clientKeystore.jks
Binary file not shown.
Binary file added
BIN
+1.99 KB
distribution/src/main/release/samples/performance/jaxrs/src/main/config/serviceKeystore.jks
Binary file not shown.
Oops, something went wrong.