-
Notifications
You must be signed in to change notification settings - Fork 224
Open
Description
Integrating the Actors API with Spring should follow the same approach as Workflows.
For example:
- Actor registration should happen when the Spring Boot application context load, it shouldn't be done by the user. -> For example:
ActorRuntime.getInstance().registerActor(DemoActorImpl.class);-> Provide@EnableDaprActorsannotation. - All ActorRuntime configuration options should be handled by Spring properties. For example:
ActorRuntime.getInstance().getConfig().setDrainOngoingCallTimeout(Duration.ofSeconds(10)); - Investigate how to handle annotations
@ActorTypeand@ActorMethod. Right now actors need to extend AbstractActor, but these are not managed Spring beans, making it difficult to integrate with the ecosystem.- It would be great to not need to extends
AbstractActoras this can be automatically done by the framework. - For state manager ->
super.getActorStateManager().set("lastmessage", something).block();it would be great to have access by using Spring@Autowiredin theActorimplementation.
- It would be great to not need to extends
The current approach push the user to define an interface annotated with @ActorType and @ActorMethod and then an implementation with the logic. Next create an implementation class that must extend AbstractActor. For a better developer experience, the framework (Spring integration) can collapse this steps into a single annotated implementation class.
This will require some investigation to common use cases and patterns about how users define their actors.
Check also: https://github.com/dapr/java-sdk/tree/master/sdk-tests/src/test/java/io/dapr/it/actors/services/springboot
References:
Metadata
Metadata
Assignees
Labels
No labels