GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — samples-java/java-dedup at main · keploy/samples-java

Expand file tree

/

java-dedup

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

java-dedup

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
keploy
keploy
 
 
src/main
src/main
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
Dockerfile.classpath
Dockerfile.classpath
 
 
Dockerfile.distroless
Dockerfile.distroless
 
 
README.md
README.md
 
 
docker-compose.classpath.yml
docker-compose.classpath.yml
 
 
docker-compose.distroless.yml
docker-compose.distroless.yml
 
 
docker-compose.restricted.yml
docker-compose.restricted.yml
 
 
docker-compose.yml
docker-compose.yml
 
 
keploy.yml
keploy.yml
 
 
pom.xml
pom.xml
 
 
run_random_1000.sh
run_random_1000.sh
 
 

README.md

Outline

Java Dynamic Deduplication Sample

A Spring Boot application used by Keploy CI to validate Java dynamic deduplication. It mirrors the Go dedup sample by exposing a broad set of endpoints and committing 400 replay fixtures across four testsets.

CI does not record this sample. The keploy/ directory is checked in so the pipeline only builds the app and runs replay with --dedup --skip-app-restart. When the sample behavior changes, record the fixtures locally and push the updated keploy/ files.

The Keploy Java SDK is attached as a Java agent at replay time. The sample does not compile against io.keploy:keploy-sdk and does not import Keploy classes in application code.

The SDK reads JaCoCo coverage in-process via org.jacoco.agent.rt.RT.getAgent().getExecutionData(...), so attach both agents when running dynamic deduplication: the Keploy agent for the control/data socket protocol, and the JaCoCo agent for runtime coverage.

Setup

mvn -B -DskipTests -Dkeploy.agent.version=2.0.6 clean package

This builds the runnable application jar, copies target/keploy-sdk.jar, and copies target/jacocoagent.jar next to it.

Run dedup natively

keploy test \
  -c "java -javaagent:target/keploy-sdk.jar -javaagent:target/jacocoagent.jar -jar target/java-dedup.jar" \
  --dedup --skip-app-restart --language java --delay 1 \
  --health-url "http://127.0.0.1:8080/healthz" \
  --health-poll-timeout 30s \
  --disableMockUpload --disableReportUpload

keploy dedup --path .

Run dedup with Docker

docker compose build
keploy test \
  -c "docker compose up" \
  --container-name "dedup-java" \
  --host "127.0.0.1" \
  --dedup --skip-app-restart --language java --delay 1 \
  --health-url "http://127.0.0.1:8080/healthz" \
  --health-poll-timeout 30s \
  --disableMockUpload --disableReportUpload

keploy dedup --path .

During keploy test, Enterprise rewrites the Compose file and injects its own shared /tmp volume for the dedup control/data sockets. The base sample Compose file does not need a host /tmp bind mount. Re-run docker compose build whenever the jar, JaCoCo agent, or Dockerfile changes so replay uses the current image.

Run dedup with direct Docker

docker compose build
keploy test \
  -c "docker run --rm --name dedup-java -p 8080:8080 java-dedup:local" \
  --container-name "dedup-java" \
  --host "127.0.0.1" \
  --dedup --skip-app-restart --language java --delay 1 \
  --health-url "http://127.0.0.1:8080/healthz" \
  --health-poll-timeout 30s \
  --disableMockUpload --disableReportUpload

keploy dedup --path .

During direct docker run, Enterprise injects the same shared /tmp volume into the app container. Do not pass your own /tmp mount in the app command.

The CI pipeline also validates additional production-style layouts for the same app, including native classpath, direct Docker run, Docker Compose, exploded classpath images, restricted runtime, restricted classpath, and distroless packaging.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.