Temporal worker poller does not start after upgrading the springboot and temporal version

I updated the application dependencies from

Old versions:
Springboot: 2.7.3
Temporal & temporal-spring-boot-autoconfigure-alpha: 1.16.0

New versions:
Springboot: 3.0.6
Temporal & temporal-spring-boot-autoconfigure-alpha: 1.19.1

The temporal worker poller seems to be not starting after the update but it works fine with the older versions. We are able to create workflows but it shows as no workers found.

Old:

New:

Application Property yaml

  spring:
    temporal:
      connection:
        target: ${TEMPORAL_HOST}:${TEMPORAL_PORT}
        target.namespace: ${TEMPORAL_NAMESPACE}
      workers:
        - task-queue: GENERIC_WORKFLOW_QUEUE
      workflow-cache:
        max-instances: 10
        max-threads: 10
      workersAutoDiscovery:
        packages: com.endowus.workflow.engine.hk
      timeouts:
        activityStartToCloseTimeout: ${ACTIVITY_START_TO_CLOSE_TIMEOUT}
        workflowTimeout: ${WORKFLOW_TIMEOUT}

Please help out on how I could resolve this. Thanks in advance!

@Anjula_Paulus I will try to reproduce this

1 Like

@antonio.perez Any update on this?

@Anjula_Paulus

I have something working using the same versions, and I can see the pollers.

2023-05-25 13:01:04.961  INFO [temporal-demo,,] 26333 --- [           main] io.temporal.internal.worker.Poller       : start: Poller{name=Workflow Poller taskQueue="DemoTaskQueue", namespace="default", identity=26333@Antonio-Perezs-MacBook-Pro.local}
2023-05-25 13:01:04.963  INFO [temporal-demo,,] 26333 --- [           main] io.temporal.internal.worker.Poller       : start: Poller{name=Activity Poller taskQueue="DemoTaskQueue", namespace="default", identity=26333@Antonio-Perezs-MacBook-Pro.local}

You can find the repo here GitHub - antmendoza/temporal_spring-boot-demo at community_8340

If you want to share something to reproduce it I can take a look

Thanks,

@antonio.perez Does this warn logs mean something?


Thanks

How to enable debig level logs in the SDK?

@Anjula_Paulus

you can add the log level to your application.yml for io.temporal

logging:
  level:
    io.temporal: debug

Does this warn logs mean something?

Looks like a spring issue Unnecessary parameter name introspection for constructor-arg resolution (leading to LocalVariableTableParameterNameDiscoverer warnings) · Issue #29612 · spring-projects/spring-framework · GitHub

@Anjula_Paulus were you able to solve this ?

@antonio.perez i am seeing the exact same behaviour .Could you checkout this demo repo to see what the issue might be ? GitHub - vijaysenthil/temporal-demo

I see this in the logs

2023-06-07T13:43:53.142-05:00  INFO 10618 --- [           main] c.temporal.example.demo.DemoApplication  : Starting DemoApplication using Java 17.0.5 with PID 10618 (/Users/vijaysenthil.veeriah/src/java17/test/temporal-demo/build/classes/java/main started by vijaysenthil.veeriah in /Users/vijaysenthil.veeriah/src/java17/test/temporal-demo)
2023-06-07T13:43:53.145-05:00  INFO 10618 --- [           main] c.temporal.example.demo.DemoApplication  : No active profile set, falling back to 1 default profile: "default"
2023-06-07T13:43:53.445-05:00  WARN 10618 --- [           main] ocalVariableTableParameterNameDiscoverer : Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: io.temporal.spring.boot.autoconfigure.properties.WorkerProperties
2023-06-07T13:43:53.450-05:00  WARN 10618 --- [           main] ocalVariableTableParameterNameDiscoverer : Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: io.temporal.spring.boot.autoconfigure.properties.WorkerProperties$CapacityConfigurationProperties
2023-06-07T13:43:53.451-05:00  WARN 10618 --- [           main] ocalVariableTableParameterNameDiscoverer : Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: io.temporal.spring.boot.autoconfigure.properties.WorkerProperties$RateLimitsConfigurationProperties
2023-06-07T13:43:53.714-05:00  INFO 10618 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 7888 (http)
2023-06-07T13:43:53.720-05:00  INFO 10618 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-06-07T13:43:53.721-05:00  INFO 10618 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.8]
2023-06-07T13:43:53.781-05:00  INFO 10618 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-06-07T13:43:53.782-05:00  INFO 10618 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 604 ms
2023-06-07T13:43:53.817-05:00  WARN 10618 --- [           main] ocalVariableTableParameterNameDiscoverer : Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: io.temporal.spring.boot.autoconfigure.properties.TemporalProperties
2023-06-07T13:43:53.818-05:00  WARN 10618 --- [           main] ocalVariableTableParameterNameDiscoverer : Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: io.temporal.spring.boot.autoconfigure.properties.WorkersAutoDiscoveryProperties
2023-06-07T13:43:53.822-05:00  WARN 10618 --- [           main] ocalVariableTableParameterNameDiscoverer : Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: io.temporal.spring.boot.autoconfigure.properties.NamespaceProperties$WorkflowCacheProperties
2023-06-07T13:43:53.823-05:00  WARN 10618 --- [           main] ocalVariableTableParameterNameDiscoverer : Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: io.temporal.spring.boot.autoconfigure.properties.ConnectionProperties
2023-06-07T13:43:54.036-05:00  INFO 10618 --- [           main] i.t.s.WorkflowServiceStubsImpl           : Created WorkflowServiceStubs for channel: ManagedChannelOrphanWrapper{delegate=ManagedChannelImpl{logId=1, target=127.0.0.1:7233}}
2023-06-07T13:43:54.282-05:00  INFO 10618 --- [           main] i.t.s.b.a.template.WorkersTemplate       : Creating configured worker for a task queue TeamTaskQueue
2023-06-07T13:43:54.305-05:00  INFO 10618 --- [           main] i.t.s.b.a.template.WorkersTemplate       : Registering auto-discovered workflow class class com.temporal.example.demo.temporal.workflow.TeamWorkflowImpl on a worker with a task queue 'TeamTaskQueue'
2023-06-07T13:43:54.307-05:00  INFO 10618 --- [           main] i.t.s.b.a.template.WorkersTemplate       : Registering auto-discovered activity bean 'FMVFActivityImpl' of class class com.temporal.example.demo.temporal.activity.team.FMVFActivityImpl on a worker with a task queue 'TeamTaskQueue'
2023-06-07T13:43:54.383-05:00  INFO 10618 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 7888 (http) with context path ''
2023-06-07T13:43:54.389-05:00  INFO 10618 --- [           main] c.temporal.example.demo.DemoApplication  : Started DemoApplication in 1.48 seconds (process running for 1.676)
2023-06-07T13:45:47.510-05:00  INFO 10618 --- [nio-7888-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-06-07T13:45:47.510-05:00  INFO 10618 --- [nio-7888-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-06-07T13:45:47.511-05:00  INFO 10618 --- [nio-7888-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2023-06-07T13:45:47.691-05:00  INFO 10618 --- [nio-7888-exec-4] o.springdoc.api.AbstractOpenApiResource  : Init duration for springdoc-openapi is: 70 ms
2023-06-07T13:45:53.319-05:00  INFO 10618 --- [nio-7888-exec-5] c.t.e.demo.controller.DemoController     : creating workflow test-7b82a350-64cf-4d71-b7cf-581d86553909

able to create workflow but the temporal engine says no workers found

as a workaround i was able to explicitly register the worker, the config based / auto discovery is the part that is not working

I didnt not have time to work on it since last time. Still havent found a solution for it. @vjv

For me this was fixed by explicitly starting the Spring application context:

ConfigurableApplicationContext applicationContext = SpringApplication.run(DemoApplication.class, args); applicationContext.start();

See this comment from RootNamespaceAutoConfiguration:

// It needs to listed on ContextStartedEvent, not ContextRefreshedEvent.
// Using ContextRefreshedEvent will cause start of workers early, during the context
// initialization
// and potentially incorrect order of bean initialization.
// Refresh event can also be fired multiple times during the context initialization.
// For this listener to ever work, Spring context needs to be actually started.
// Note that a lot of online samples for Spring don't start the context at all:
// https://stackoverflow.com/questions/48099355/contextstartedevent-not-firing-in-custom-listener
1 Like

thanks @chris I can confirm that fixed it for me too :pray: Would be awesome if this was called out in the temporal spring boot starter page

I recently upgraded to Spring boot 3.2.4 and Temporal 1.22.3. After upgrading, I see the same issue. I also have the application context started explicitly.