Package akka.javasdk.client
Interface ComponentClient
@DoNotInherit
public interface ComponentClient
Utility to send requests to other components by composing a call that can be executed by the
runtime. To compose a call:
- select component type (and pass id if necessary)
- select component method, by using Java method reference operator (::)
- provide a request parameter (if required)
Example of use on a cross-component call:
public CompletionStage<Done> addItem(String cartId, ShoppingCart.LineItem item) {
return componentClient.forEventSourcedEntity(cartId)
.method(ShoppingCartEntity::addItem)
.invokeAsync(item);
}
Not for user extension, implementation provided by the SDK.-
Method Summary
Modifier and TypeMethodDescriptionforAgent()SelectAgentas a call target component.forEventSourcedEntity(String eventSourcedEntityId) SelectEventSourcedEntityas a call target component.forKeyValueEntity(String keyValueEntityId) SelectKeyValueEntityas a call target component.SelectTimedActionas a call target component.forView()SelectViewas a call target component.forWorkflow(String workflowId) SelectWorkflowas a call target component.
-
Method Details
-
forTimedAction
TimedActionClient forTimedAction()SelectTimedActionas a call target component. -
forKeyValueEntity
SelectKeyValueEntityas a call target component.- Parameters:
keyValueEntityId- - key value entity id used to create a call. Must not be null or empty string.
-
forEventSourcedEntity
SelectEventSourcedEntityas a call target component.- Parameters:
eventSourcedEntityId- - event sourced entity id used to create a call. Must not be null or empty string.
-
forWorkflow
SelectWorkflowas a call target component.- Parameters:
workflowId- - workflow id used to create a call. Must not be null or empty string.
-
forView
ViewClient forView()SelectViewas a call target component. -
forAgent
AgentClient forAgent()SelectAgentas a call target component.
-