Skip to content

feature: enable virtual threads, migrate RestTemplate to RestClient, remove stray root properties file - #70

Merged
devin-ai-integration[bot] merged 1 commit into
devin/1786033413-java21-boot3-basefrom
devin/1786033685-runtime-config-restclient
Aug 6, 2026
Merged

devin-ai-integration[bot] merged 1 commit into
devin/1786033413-java21-boot3-basefrom
devin/1786033685-runtime-config-restclient

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Runtime-configuration slice on top of the Java 21 / Spring Boot 3.5 upgrade (#69). Three things, all verified against a running app rather than a compile:

1. Virtual threads actually on. The repo had no classpath application.properties at all — the one at the repo root is not under src/main/resources, so Spring never read it. Added src/main/resources/application.properties with spring.threads.virtual.enabled=true, and deleted the dead root file (its only content was a commented-out #server.port = 8081, carried over into the real file). The dead file also polluted the /topic/file/operation listing, which walks the process working directory; that listing is now one entry shorter.

Proven with a throwaway /thread-probe endpoint (removed before commit):

VirtualThread[#44,tomcat-handler-0]/runnable@ForkJoinPool-1-worker-1 virtual=true

2. RestTemplateRestClient. RestTemplate is in maintenance mode; RestClient is the modern synchronous client. RestTemplateConfigRestClientConfig (now building from the auto-configured RestClient.Builder), and the quote fetch becomes:

Quote quote = restClient.get().uri(QUOTE_URL).retrieve().body(Quote.class);

The important part is that startup resilience does not regress — the upstream quote service gturnquist-quoters.cfapps.io is dead, and the app must log a WARN and keep going (the bug the base PR just fixed). Verified empirically rather than assumed: RestClient wraps the connection failure in ResourceAccessException, which is a RestClientException, so the existing catch clause still applies unchanged. Running the built jar:

INFO  hello.Application : Started Application in 1.129 seconds
WARN  hello.Application : Could not fetch a quote from http://gturnquist-quoters.cfapps.io/api/random: I/O error on GET request ...

3. Stream cleanup in Application.run(...): Arrays.asList(...).stream().map(...).collect(Collectors.toList())Stream.of(...).<Object[]>map(...).toList(). Safe because the result is only iterated and handed to batchUpdate, never mutated.

Verification

  • ./mvnw clean verify passes on JDK 21.
  • App run via ./mvnw spring-boot:run and the built jar; every endpoint curled. JSON shapes unchanged: /{"id":1,"content":"Hello, World!"}, /topic[{"id":...,"subjectName":...,"subjectDescription":...}]. /topic GET/POST/PUT/DELETE, /topic/sort, /topic/minimum/length/{n}, /topic/string/operation, /topic/file/operation, /datetime all behave as before.
  • Pre-existing and unrelated: GET /topic/1 (a non-existent id) returns 500 on the base branch too — TopicService calls Optional.get() on a missing topic. Not fixed here; service/ is outside this slice.

No files outside this slice were modified; pom.xml untouched.

Link to Devin session: https://app.devin.ai/sessions/57144a6d7b48468bbe7d6e587aabf483


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

…drop stray root properties file

Co-Authored-By: alex.vyshetsky <alex.vyshetsky@cognition.ai>
@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, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot merged commit 1bc25da into devin/1786033413-java21-boot3-base Aug 6, 2026
1 check passed
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.

0 participants