Interface Action.Effect<T>

Type Parameters:
T - The type of the message that must be returned by this call.
Enclosing class:
Action

public static interface Action.Effect<T>
An Effect is a description of what Kalix needs to do after the command is handled. You can think of it as a set of instructions you are passing to Kalix. Kalix will process the instructions on your behalf.

Each Kalix component defines its own effects, which are a set of predefined operations that match the capabilities of that component.

An Action Effect can either:

  • reply with a message to the caller
  • reply with a message to be published to a Topic (in case the method is a publisher)
  • forward the message to another component
  • return an error
  • ignore the call
  • Method Details

    • addSideEffect

      Action.Effect<T> addSideEffect(SideEffect... sideEffects)
      Attach the given side effects to this reply.
      Parameters:
      sideEffects - The effects to attach.
      Returns:
      A new reply with the attached effects.
    • addSideEffects

      Action.Effect<T> addSideEffects(Collection<SideEffect> sideEffects)
      Attach the given side effects to this reply.
      Parameters:
      sideEffects - The effects to attach.
      Returns:
      A new reply with the attached effects.
    • canHaveSideEffects

      boolean canHaveSideEffects()
      Returns:
      true if this effect supports attaching side effects, if returning false addSideEffects will throw an exception.