Class ComponentClient

Object
kalix.javasdk.client.ComponentClient

public class ComponentClient extends Object
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);
 }
 
  • Constructor Details

    • ComponentClient

      public ComponentClient(kalix.spring.KalixClient kalixClient)
  • Method Details

    • forAction

      public ActionCallBuilder forAction()
      Select Action as a call target component.
    • forValueEntity

      public ValueEntityCallBuilder forValueEntity()
      Select ValueEntity as a call target component.

      For calling methods annotated with @GenerateId

    • forValueEntity

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

      public ValueEntityCallBuilder forValueEntity(String... valueEntityIds)
      Select ValueEntity as a call target component.
      Parameters:
      valueEntityIds - - compound entity ids used to create a call.
    • forEventSourcedEntity

      public EventSourcedEntityCallBuilder forEventSourcedEntity()
      Select EventSourcedEntity as a call target component.

      For calling methods annotated with @GenerateId

    • forEventSourcedEntity

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

      public EventSourcedEntityCallBuilder forEventSourcedEntity(String... eventSourcedEntityIds)
      Select EventSourcedEntity as a call target component.
      Parameters:
      eventSourcedEntityIds - - compound entity ids used to create a call.
    • forWorkflow

      public WorkflowCallBuilder forWorkflow()
      Select Workflow as a call target component.

      For calling methods annotated with @GenerateId

    • forWorkflow

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

      public WorkflowCallBuilder forWorkflow(String... workflowIds)
      Select Workflow as a call target component.
      Parameters:
      workflowIds - - compound workflow ids used to create a call.
    • forView

      public ViewCallBuilder forView()
      Select View as a call target component.