You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When workers-auto-discovery is configured and @Profile annotation is used on top of @WorkflowImpl, if the profile condition doesn't match, the workflow should not be used.
Actual Behavior
Regardless of the condition in @Profile all classes annotated with @WorkflowImpl will be used.
Steps to Reproduce the Problem
Create a workflow and its implementation SomeWorkflowImpl
Annotate SomeWorkflowImpl with @WorkflowImpl and @Profile("!local")
Run the application with local spring profile. The SomeWorkflowImpl can still be discovered and workers will be created.
Profile effects what beans are included, technically workflow classes are not beans by intention, but I think it would be resonable here to respect Profile. Are you aware of any other spring boot projects that apply Profile to non beans?
Are you aware of any other spring boot projects that apply Profile to non beans?
No I haven't know whether there're such projects. I am not saying we should do that but there seems to be missing some Spring-aware configurations to dynamically disable some task queue/workers. Maybe This can be achieved by some configuration beans before starting the workers?
What I am doing now is set the auto start worker to false, and manually register the conditional workers to worker factory. Maybe this kind of operations can be configured by some beans?
Expected Behavior
When
workers-auto-discovery
is configured and@Profile
annotation is used on top of@WorkflowImpl
, if the profile condition doesn't match, the workflow should not be used.Actual Behavior
Regardless of the condition in
@Profile
all classes annotated with@WorkflowImpl
will be used.Steps to Reproduce the Problem
@WorkflowImpl
and@Profile("!local")
local
spring profile. The SomeWorkflowImpl can still be discovered and workers will be created.Specifications
Some investigations
ClassPathScanningCandidateComponentProvider is used to scan the package to find workflows.
But it seems the Environment is not passed in. According to spring doc
The Environment is need to evaluate
@Conditional
annotations.The text was updated successfully, but these errors were encountered: