Commit fcf66bf3 authored by KT315's avatar KT315

Rapidoid dummy

parent dcb44de1
target
\ No newline at end of file
Build:
$ mvn compile
$ mvn package
Run:
$ java -cp target/rapidoid_dummy-1.0-SNAPSHOT-jar-with-dependencies.jar com.stressgrid.rapidoid.dummy.App production=true on.port=5000 on.address=0.0.0.0
\ No newline at end of file
<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>
<groupId>com.stressgrid.rapidoid.dummy</groupId>
<artifactId>rapidoid_dummy</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>rapidoid_dummy</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.rapidoid</groupId>
<artifactId>rapidoid-web</artifactId>
<version>5.5.5</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.stressgrid.rapidoid.dummy;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import org.rapidoid.job.Jobs;
import org.rapidoid.setup.On;
/**
* Hello world!
*
*/
public class App
{
private static final byte[] PAYLOAD = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis dictum ligula, ut sagittis nisl malesuada nec. Fusce hendrerit leo augue, nec pretium dolor porta sodales. Sed consequat sed purus eu aliquet. Etiam laoreet nibh vel ex sodales, non egestas lorem tempor. Pellentesque placerat facilisis felis, nec bibendum metus finibus quis. Donec lobortis, sapien at tristique placerat, nibh libero volutpat eros, eget mollis nibh elit et enim. Vestibulum consequat ut lorem sed eleifend. Ut eu dolor ut lectus faucibus rhoncus. Nam vestibulum vitae massa vel congue. Nam ac odio lacus. Nam condimentum ante eget mollis vestibulum. Cras nisi sapien, tempor nec diam at, vulputate cursus odio. Maecenas vitae tellus efficitur arcu mollis ultrices id vitae ex. Suspendisse potenti. Duis nec vestibulum dui. Donec ultricies sit amet lorem eu feugiat. Ut pretium vitae lectus at tempor. Curabitur condimentum arcu varius nulla ultricies, id feugiat odio dictum. Vivamus sollicitudin consectetur nullam.".getBytes();
public static void main( String[] args )
{
org.rapidoid.setup.App.run(args);
On.get("/").plain((req) -> Jobs.schedule(() -> {
req.response().result(PAYLOAD).done();
}, 100 + (5 - ThreadLocalRandom.current().nextInt(0, 10)), TimeUnit.MILLISECONDS));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment