Package kalix.javasdk.client
Interface ComponentClient
- All Known Implementing Classes:
ComponentClientImpl
public interface ComponentClient
Utility to send requests to other Kalix components by composing a DeferredCall. To compose a
call:
- select component type (and pass id if necessary)
- select component method, by using Java method reference operator (::)
- provide parameters (if required)
Example of use on a cross-component call:
public Effect<String> createUser(String userId, String email, String name) {
//validation here
var defCall = componentClient.forValueEntity(userId).call(UserEntity::createUser).params(email, name);
return effects().forward(defCall);
}
-
Method Summary
Modifier and TypeMethodDescriptionSelect Action as a call target component.Select EventSourcedEntity as a call target component.forEventSourcedEntity
(String eventSourcedEntityId) Select EventSourcedEntity as a call target component.forEventSourcedEntity
(String... eventSourcedEntityIds) Select EventSourcedEntity as a call target component.Select ValueEntity as a call target component.forValueEntity
(String valueEntityId) Select ValueEntity as a call target component.forValueEntity
(String... valueEntityIds) Select ValueEntity as a call target component.forView()
Select View as a call target component.Select Workflow as a call target component.forWorkflow
(String workflowId) Select Workflow as a call target component.forWorkflow
(String... workflowIds) Select Workflow as a call target component.
-
Method Details
-
forAction
ActionCallBuilder forAction()Select Action as a call target component. -
forValueEntity
ValueEntityCallBuilder forValueEntity()Select ValueEntity as a call target component.For calling methods annotated with @
GenerateId
-
forValueEntity
Select ValueEntity as a call target component.- Parameters:
valueEntityId
- - value entity id used to create a call.
-
forValueEntity
Select ValueEntity as a call target component.- Parameters:
valueEntityIds
- - compound entity ids used to create a call.
-
forEventSourcedEntity
EventSourcedEntityCallBuilder forEventSourcedEntity()Select EventSourcedEntity as a call target component.For calling methods annotated with @
GenerateId
-
forEventSourcedEntity
Select EventSourcedEntity as a call target component.- Parameters:
eventSourcedEntityId
- - event sourced entity id used to create a call.
-
forEventSourcedEntity
Select EventSourcedEntity as a call target component.- Parameters:
eventSourcedEntityIds
- - compound entity ids used to create a call.
-
forWorkflow
WorkflowCallBuilder forWorkflow()Select Workflow as a call target component.For calling methods annotated with @
GenerateId
-
forWorkflow
Select Workflow as a call target component.- Parameters:
workflowId
- - workflow id used to create a call.
-
forWorkflow
Select Workflow as a call target component.- Parameters:
workflowIds
- - compound workflow ids used to create a call.
-
forView
ViewCallBuilder forView()Select View as a call target component.
-