Package akka.javasdk.annotations
Annotation Interface Consume.FromServiceStream
- Enclosing class:
Consume
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
Modifier and TypeRequired ElementDescriptionThe unique identifier of the stream in the producing serviceThe 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
Modifier and TypeOptional ElementDescriptionIn 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
-
Element Details
-
id
String idThe unique identifier of the stream in the producing service -
service
String serviceThe 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.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.
-
consumerGroup
String consumerGroupIn 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 ignoreUnknownWhen 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
- Default:
false
-