Hi team, i’m new to Temporal. Im using Temporal with my Spring boot project
with gradle implementation group: 'io.temporal', name: 'temporal-spring-boot-starter-alpha', version:1.23.2 and Java 11
Here my use case is to have activity options like startToClose, Heartbeat, and MaxRetryAttempts as configurable. Currently for me having it as part of constructor works at run time
Its not a component, but I will check and update here
2.a I will try the option 1, just to be more clear here you mention local activity will be the Normal ActivityImpl returning this configuration right ?
something like this
workflowImplMethod(){
ActivityOptions configActivity = config.getConfigs()
// build new stub with the config passed
stub.activity1();
}
not really, so your workflow impl would just execute a local activity, something like:
FetchOptionsActivity fetchOptionsActivity =
Workflow.newLocalActivityStub(
FetchOptionsActivity.class,
LocalActivityOptions.newBuilder()
.setStartToCloseTimeout(Duration.ofSeconds(2))
.build());
// ...
MyActivityOptions myActivityOptions = fetchOptionsActivity.getOptions();
// use myActivityOptions now to create activity stubs
and this local activity can be a Component that can return beans, something like:
@Component
@ActivityImpl(taskQueues = "myTaskQueue") // note for local activity this has to be same
//task queue as what you define for you workflow impls as local activities are executed
// as part of your workflow task
public class FetchOptionsActivityImpl implements FetchOptionsActivity {
@Autowired MyActivityOptions options;
@Override
public MyActivityOptions getOptions() {
return options;
}
}