Annotation Interface Consume.FromServiceStream

Enclosing class:
Consume

@Target(TYPE) @Retention(RUNTIME) @Documented public static @interface Consume.FromServiceStream
Annotation for consuming messages from another service.

The underlying method must be declared to receive one parameter for the received messages. Use one method with the common event type as parameter, or several methods with different parameter types corresponding to different message types.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The unique identifier of the stream in the producing service
    The deployed name of the service to consume from, can be the deployed name of another service in the same project or a fully qualified public hostname of a service in a different project.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    In case you need to consume the same stream multiple times, each subscription should have a unique consumer group.
    boolean
    When there is no method in the class whose input type matches the event type: if ignoreUnknown is true the event is discarded if false, an Exception is raised
    The platform service the producing service belongs to, when consuming from a service that is part of a platform service enabled in this project rather than a service in the project itself.
  • Element Details

    • id

      String id
      The unique identifier of the stream in the producing service
    • service

      String service
      The deployed name of the service to consume from, can be the deployed name of another service in the same project or a fully qualified public hostname of a service in a different project. Together with platformService(), it is the bare name of a service in that platform service.

      Note: The service name is used as unique identifier for tracking progress when consuming it. Changing this name will lead to starting over from the beginning of the event stream.

      Can be a template referencing an environment variable "${MY_ENV_NAME}" set for the service at deployment.

    • platformService

      String platformService
      The platform service the producing service belongs to, when consuming from a service that is part of a platform service enabled in this project rather than a service in the project itself. Empty when the producing service is a service in this project.

      When set, service() must be a bare service name. Neither value can be a template.

      Note: The platform service is part of the identifier for tracking progress. Setting or changing it starts over from the beginning of the event stream.

      In dev mode, the producing service is looked up by name only. In the test kit, a mocked stream is registered by service name and stream id, and also applies to a service with that name in a platform service. A deployment outside the Akka platform fails at start with this setting.

      Default:
      ""
    • consumerGroup

      String consumerGroup
      In case you need to consume the same stream multiple times, each subscription should have a unique consumer group.

      Changing the consumer group will lead to starting over from the beginning of the stream.

      Default:
      ""
    • ignoreUnknown

      boolean ignoreUnknown
      When there is no method in the class whose input type matches the event type:
      • if ignoreUnknown is true the event is discarded
      • if false, an Exception is raised

      Be aware that this class then also discards message types that the producer adds later, before this class has a method for them, and never processes those messages.

      Default:
      false