Package io.dapr.springboot
Class DaprController
- java.lang.Object
-
- io.dapr.springboot.DaprController
-
@RestController public class DaprController extends Object
SpringBoot Controller to handle callback APIs for Dapr.
-
-
Constructor Summary
Constructors Constructor Description DaprController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]daprConfig()Returns Dapr's configuration for Actors.byte[]daprSubscribe()Returns the list of subscribed topics.reactor.core.publisher.Mono<Void>deactivateActor(String type, String id)Handles API to deactivate an actor.voidhealthz()Callback API for health checks from Dapr's sidecar.reactor.core.publisher.Mono<byte[]>invokeActorMethod(String type, String id, String method, byte[] body)Handles API to invoke an actor's method.reactor.core.publisher.Mono<Void>invokeActorReminder(String type, String id, String reminder, byte[] body)Handles API to trigger an actor's reminder.reactor.core.publisher.Mono<Void>invokeActorTimer(String type, String id, String timer, byte[] body)Handles API to trigger an actor's timer.
-
-
-
Method Detail
-
healthz
@GetMapping(path="/healthz") public void healthz()
Callback API for health checks from Dapr's sidecar.
-
daprConfig
@GetMapping(path="/dapr/config", produces="application/json") public byte[] daprConfig() throws IOExceptionReturns Dapr's configuration for Actors.- Returns:
- Actor's configuration.
- Throws:
IOException- If cannot generate configuration.
-
daprSubscribe
@GetMapping(path="/dapr/subscribe", produces="application/json") public byte[] daprSubscribe() throws IOExceptionReturns the list of subscribed topics.- Returns:
- List of subscribed topics.
- Throws:
IOException- If cannot generate list of topics.
-
deactivateActor
@DeleteMapping(path="/actors/{type}/{id}") public reactor.core.publisher.Mono<Void> deactivateActor(@PathVariable("type") String type, @PathVariable("id") String id)Handles API to deactivate an actor.- Parameters:
type- Actor type.id- Actor Id.- Returns:
- Void.
-
invokeActorMethod
@PutMapping(path="/actors/{type}/{id}/method/{method}") public reactor.core.publisher.Mono<byte[]> invokeActorMethod(@PathVariable("type") String type, @PathVariable("id") String id, @PathVariable("method") String method, @RequestBody(required=false) byte[] body)Handles API to invoke an actor's method.- Parameters:
type- Actor type.id- Actor Id.method- Actor method.body- Raw request body.- Returns:
- Raw response body.
-
invokeActorTimer
@PutMapping(path="/actors/{type}/{id}/method/timer/{timer}") public reactor.core.publisher.Mono<Void> invokeActorTimer(@PathVariable("type") String type, @PathVariable("id") String id, @PathVariable("timer") String timer, @RequestBody byte[] body)Handles API to trigger an actor's timer.- Parameters:
type- Actor type.id- Actor Id.timer- Actor timer's name.body- Raw request's body.- Returns:
- Void.
-
invokeActorReminder
@PutMapping(path="/actors/{type}/{id}/method/remind/{reminder}") public reactor.core.publisher.Mono<Void> invokeActorReminder(@PathVariable("type") String type, @PathVariable("id") String id, @PathVariable("reminder") String reminder, @RequestBody(required=false) byte[] body)Handles API to trigger an actor's reminder.- Parameters:
type- Actor type.id- Actor Id.reminder- Actor reminder's name.body- Raw request's body.- Returns:
- Void.
-
-