Skip to content

feat: add web demo for producer/consumer testing with JDK queue#3

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1775813257-add-web-demo
Open

feat: add web demo for producer/consumer testing with JDK queue#3
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1775813257-add-web-demo

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Adds a browser-based demo application (test scope) for interactively testing the itqueue producer/consumer flow using the JDK in-memory queue backend (no Redis required).

New test files:

  • DemoApplication.java — Spring Boot entry point excluding Redis and ItQueueAutoConfig
  • QueueController.java — REST controller exposing /api/send, /api/send-batch, /api/consumed, /api/produced, /api/errors, /api/clear
  • index.html — Single-page UI with producer form, consumer view, live stats, and activity log

pom.xml changes:

  • Added spring-boot-starter-web (test scope) for the embedded Tomcat server
  • Bumped maven-compiler-plugin from unversioned (3.1) to 3.11.0 and added Lombok annotationProcessorPaths to fix Lombok setter generation during compilation

How to run: mvn test-compile && java -cp "target/classes:target/test-classes:$(mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=/dev/stdout -q)" io.github.ithamal.queue.demo.DemoApplication, then open http://localhost:8080.

Review & Testing Checklist for Human

  • maven-compiler-plugin changes affect production build — The version bump to 3.11.0 and the added annotationProcessorPaths are NOT test-scoped; they change how the main artifact is compiled. Verify this doesn't alter the published JAR behavior or break existing CI.
  • Unchecked cast in sendBatch(Integer) body.getOrDefault("count", 5) may throw ClassCastException if Jackson deserializes the JSON number as a different type (e.g., Long). Test with various count values.
  • XSS in index.html${m.payload} is injected directly into innerHTML without escaping. Low risk since this is test-only, but worth noting if the demo is shared.
  • Run the demo locally: send single messages, batch messages, and verify consumed count matches produced count with 0 errors.

Notes

  • Message IDs display as null because the JDK queue backend does not assign IDs (only Redis backends do). The consumer.ack(null) call is effectively a no-op in the JDK implementation.
  • The in-memory message lists (ConcurrentLinkedQueue) grow unbounded — acceptable for a demo but not production use.

Link to Devin session: https://app.devin.ai/sessions/32eb0f67b07f482ab5e68b341d831103
Requested by: @kenlin8827

Co-Authored-By: kenlin <kenlin8827@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant