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:
  1. select component type (and pass id if necessary)
  2. select component method, by using Java method reference operator (::)
  3. 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 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

      ValueEntityCallBuilder forValueEntity(String valueEntityId)
      Select ValueEntity as a call target component.
      Parameters:
      valueEntityId - - value entity id used to create a call.
    • forValueEntity

      ValueEntityCallBuilder forValueEntity(String... valueEntityIds)
      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

      EventSourcedEntityCallBuilder forEventSourcedEntity(String eventSourcedEntityId)
      Select EventSourcedEntity as a call target component.
      Parameters:
      eventSourcedEntityId - - event sourced entity id used to create a call.
    • forEventSourcedEntity

      EventSourcedEntityCallBuilder forEventSourcedEntity(String... eventSourcedEntityIds)
      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

      WorkflowCallBuilder forWorkflow(String workflowId)
      Select Workflow as a call target component.
      Parameters:
      workflowId - - workflow id used to create a call.
    • forWorkflow

      WorkflowCallBuilder forWorkflow(String... workflowIds)
      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.