How to get the worker identity through Java SDK

I need the handle to the worker poller identity that is logged by Temporal on startup and can be seen in the UI against Activity/Workflow Task Handlers. Is there a way to get it through the java sdk ?

You cannot get it, but you can set your own using WorkflowClientOptions.identity property. If not set the following code is used to generate one:

      String name = identity == null ? ManagementFactory.getRuntimeMXBean().getName() : identity;
1 Like