Skip to content

Comments

fix nexus-service-bean explicitConfig support#2789

Merged
mnichols merged 2 commits intomasterfrom
nexus-explicit-config-fix
Feb 19, 2026
Merged

fix nexus-service-bean explicitConfig support#2789
mnichols merged 2 commits intomasterfrom
nexus-explicit-config-fix

Conversation

@mnichols
Copy link
Contributor

It is not possible to register Nexus services via explicit config today (nexus-service-beans).

Expected Behavior

@Service implementations should be registered on a Temporal Worker without using AutoConfiguration (aka explicit configuration).

The problem is, Nexus Spring registration is not fully tested.
This config fails in ExplicitConfigTest

spring:
  config:
    activate:
      on-profile: explicit-config
  temporal:
    workers:
      - task-queue: UnitTest
        workflow-classes:
          - io.temporal.spring.boot.autoconfigure.bytaskqueue.TestWorkflowImpl
        activity-beans:
          - TestActivityImpl
       # this should register the service impl but fails. See stack trace
        nexus-service-beans:
          - TestNexusServiceImpl

Actual Behavior

When bringing up a worker doing explicit config only (spring), the @ServiceImpl attribute is not found while registering the service even when the attribute is present and correct.

Caused by:
                java.lang.IllegalArgumentException: Missing @ServiceImpl annotation
                    at io.nexusrpc.handler.ServiceImplInstance.fromInstance(ServiceImplInstance.java:25)
                    at io.temporal.spring.boot.autoconfigure.template.WorkersTemplate.lambda$createWorkerFromAnExplicitConfig$7(WorkersTemplate.java:400)

Steps to Reproduce the Problem

  1. Actually use explicit config with Nexus somewhere in tests that has nexus-service-beans.

The problem is we are using AopUtils to unpack the bean before getting the @serviceImpl definition but that is passing the class, not the implementation.

The fix is to just pass the bean in directly and tests pass.

Specifications

See tests

@mnichols mnichols requested a review from a team as a code owner February 18, 2026 17:59
Copy link
Contributor

@Quinn-With-Two-Ns Quinn-With-Two-Ns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, this will require SDK team approval

@mnichols
Copy link
Contributor Author

By the way, if you need to workaround this bug right now you can just autodiscover on the services package (if you've isolated your Nexus services) and do explicit config for the rest. Eg

  temporal:
    connection:
      # Connection settings
      target: ${TEMPORAL_ADDRESS:localhost:7233}

      # API Key for Temporal Cloud
      api-key: ${TEMPORAL_API_KEY:}

    start-workers: true
    namespace: ${TEMPORAL_NAMESPACE:default}
    workers:
      - task-queue: processing
        workflow-classes:
          - com.acme.processing.workflows.OrderImpl
#        nexus-service-beans:
#          - processing-service
    workers-auto-discovery:
      packages: com.acme.processing.services
      ```

@mnichols mnichols added the bug Something isn't working label Feb 18, 2026
@mnichols mnichols merged commit 81f3cc3 into master Feb 19, 2026
35 of 37 checks passed
@mnichols mnichols deleted the nexus-explicit-config-fix branch February 19, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants