Package akka.javasdk
Interface OriginAwareContext
- All Superinterfaces:
Context
- All Known Subinterfaces:
MessageContext,UpdateContext
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturnstrueif this message originated in the same region where it is currently being processed.When available, this method returns the region where a message was first created.Methods inherited from interface akka.javasdk.Context
selfRegion
-
Method Details
-
originRegion
When available, this method returns the region where a message was first created.- It returns a non-empty Optional when consuming events from an
EventSourcedEntityor a change updates from aKeyValueEntity - It returns an empty Optional when consuming messages from a topic (see
Consume.FromTopic) or from another service (seeConsume.FromServiceStream)
- Returns:
- the region where a message was first created. When not applicable, it returns an empty Optional.
- It returns a non-empty Optional when consuming events from an
-
hasLocalOrigin
default boolean hasLocalOrigin()Returnstrueif this message originated in the same region where it is currently being processed. A message is considered to have originated in a region if it was created in that region. In all other regions, the same message is treated as a replication.For messages coming from Akka entities:
- If the message is an event from an
EventSourcedEntityor a change update from aKeyValueEntity, it returnstrueif it was originated in the region where this consumer is running. Otherwise, it returnsfalse. - This method will always return
falsewhen consuming messages from another service (seeConsume.FromServiceStream) or from a topic (seeConsume.FromTopic).
- Returns:
trueif the message originated in the current processing region,falseotherwise
- If the message is an event from an
-