Virtual thread property Java Spring

Hello,

We are using temporal with Java Spring and have all our worker options set in the spring properties files including task queue names, capacity, worker classes, etc. I am trying to set all the workers to use virtual threads using:

spring:
temporal:
workers:
- task-queue: “sample queue”
virtual-threads:
using-virtual-threads: true

But this does not seem to work as Thread.currentThread().isVirtual() is always false. Is there a way to specify this?

Which sdk version are you using?
There are two properties that you need to set, for worker cache and workers, this is example you could follow, let us know if unblocks:

temporal:
    namespace: default
    connection:
      target: 127.0.0.1:7233
    workflowCache:
      using-virtual-workflow-threads: true
    workers:
      - task-queue: HelloSampleTaskQueue
        virtual-threads:
          using-virtual-threads: true
    workersAutoDiscovery:
      packages: io.temporal.samples.springboot

Hey tihomir!

This works when I add the workflow-cache property along with the individual workflow property. Thank you!!