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 TypeMethodDescriptionforEventSourcedEntity
(String eventSourcedEntityId) SelectEventSourcedEntity
as a call target component.forKeyValueEntity
(String keyValueEntityId) SelectKeyValueEntity
as a call target component.SelectTimedAction
as a call target component.forView()
SelectView
as a call target component.forWorkflow
(String workflowId) SelectWorkflow
as a call target component.
-
Method Details
-
forTimedAction
TimedActionClient forTimedAction()SelectTimedAction
as a call target component. -
forKeyValueEntity
SelectKeyValueEntity
as a call target component.- Parameters:
keyValueEntityId
- - key value entity id used to create a call. Must not be null or empty string.
-
forEventSourcedEntity
SelectEventSourcedEntity
as a call target component.- Parameters:
eventSourcedEntityId
- - event sourced entity id used to create a call. Must not be null or empty string.
-
forWorkflow
SelectWorkflow
as a call target component.- Parameters:
workflowId
- - workflow id used to create a call. Must not be null or empty string.
-
forView
ViewClient forView()SelectView
as a call target component.
-