Package akka.javasdk
Interface OriginAwareContext
- All Superinterfaces:
Context
- All Known Subinterfaces:
MessageContext,UpdateContext
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturnstrueif this message originated in the current processing region, and for messages consumed from a topic or another service.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
EventSourcedEntity, a change updates from aKeyValueEntityor aWorkflow - 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 current processing region, and for messages consumed from a topic or another service.The result depends on the message source:
- If the message originates from an
EventSourcedEntity,KeyValueEntity, orWorkflowin the same region as this consumer is running, it returnstrue. - When consuming messages from another service (see
Consume.FromServiceStream) or from a topic (seeConsume.FromTopic), it returnstrue. This does not establish where the message was created or prevent processing in multiple regions.
- Returns:
trueif the message originated from a component in the current processing region, from a broker or from service-to-service eventing,falseotherwise.
- If the message originates from an
-