Skip to content

christopher-etancelin/jcstress-devoxx-demo

Repository files navigation

DEVOXX Concurrent Like Client

This project demonstrates a concurrent Java client designed to interact with a like-counting service, likely simulating multiple users sending "like" requests simultaneously. It also includes Java Concurrency Stress (JCStress) tests to verify the correctness of concurrent operations within the application's domain logic.

Table of Contents

Prerequisites

  • Java Development Kit (JDK) 17 or newer: Ensure you have a compatible JDK installed.
  • Gradle: This project uses the Gradle Wrapper, so you don't need to install Gradle separately.

Building the Project

To build the project, including compiling Java code and packaging JARs, use the Gradle wrapper:

# On Linux/macOS
./gradlew build

# On Windows (using Command Prompt or PowerShell)
.\gradlew.bat build

This will generate the necessary build artifacts in the build/ and app/build/ directories.

Running the concurrent client

The ConcurrentVoteClient simulates concurrent votes across multiple items ("item1" to "item4"). This tests both the individual counters and the integrity of the underlying HashMap.

Resetting Counts

You can reset the counts using DELETE requests:

# Reset votes
curl -X DELETE http://localhost:7070/votes

Running JCStress Tests

To run JCStress tests:

# On Linux/macOS
./gradlew jcstress
cd scripts
./jcstress-jmm-test.sh
cd scripts
./jcstress-db-test.sh

On Windows

.\gradlew.bat jcstress

After execution, the JCStress reports, including detailed results and findings, can be found in:

  • build/reports/jcstress/
  • build/tmp/jcstress/ (for raw output and intermediate files)

Specifically, look for index.html in build/reports/jcstress/ for a readable report.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors