Skip to content

Update VirtualThread client and server correctness fixes - #2866

Open
mattrpav wants to merge 1 commit into
apache:mainfrom
mattrpav:amq-virtual-thread-per-runner
Open

mattrpav wants to merge 1 commit into
apache:mainfrom
mattrpav:amq-virtual-thread-per-runner

Conversation

@mattrpav

@mattrpav mattrpav commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Background

First iteration of Virtual Thread task runner created a VT per-wakeup. This moves to create a VT per-Task and is more inline with how the other runners work. This is specifically shows improvement for fast ack'n non-persistent consumers.

  • Update Virtual Thread Task Runner to be VT-per-task
  • Fix client-side usage of VT
  • Add tests

ref: client-side fixes was in previous PR [#2766]

…ixes

One long-lived virtual thread per TaskRunner that parks between work,
replacing the thread per wakeup submission, with termination logged on
unexpected errors. No-arg shutdown() waits for the running iteration,
matching the pooled and dedicated runners.

Client-side fixes: load the java21 classes through this artifact's own
class loader so client factories work without setThreadClassLoader,
honor the system property in task runner selection the same as in
executor setup, create the failover reconnect task on first use so the
virtual thread setting reaches it, propagate the connection factory
flag to the failover transport, and keep the task runner settings
across serialization and JNDI.

Tests: task runner behavior (thread identity, wakeup delivery, shutdown
bounds and contract, failure logging, thread release) run through both
the factory flag and the system property, the client configuration
precedence matrix, session dispatch and failover reconnect on both
thread types.
@mattrpav
mattrpav force-pushed the amq-virtual-thread-per-runner branch from 6c733f4 to 62abafa Compare November 14, 2026 19:47
@mattrpav mattrpav changed the title Update VirtualThreadTaskRunner to optimize and have one virtual thread per-task Update VirtualThread client and server correctness fixes Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant