Java DSL throws exception when using `typed.javadsl.EventSourcedBehavior#lastSequenceNumber` · Issue #32433 · akka/akka · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When handling the first event in the event handler:
java.lang.IllegalStateException: Cannot extract the lastSequenceNumber in state akka.actor.typed.internal.BehaviorImpl$DeferredBehavior$$anon$1
at akka.persistence.typed.scaladsl.EventSourcedBehavior$.lastSequenceNumber(EventSourcedBehavior.scala:115)
at akka.persistence.typed.javadsl.EventSourcedBehavior.lastSequenceNumber(EventSourcedBehavior.scala:263)
at perf.test.iot.DeviceEntity.eventHandler(DeviceEntity.java:82)
at akka.persistence.typed.javadsl.EventSourcedBehavior.createEventSourcedBehavior(EventSourcedBehavior.scala:224)
at akka.persistence.typed.javadsl.EventSourcedBehavior.apply(EventSourcedBehavior.scala:207)
I think that pattern matching should also cover Deferred wrapper:
The text was updated successfully, but these errors were encountered:
aludwiko
changed the title
Java DSL throws exception when using akka.persistence.typed.javadsl.EventSourcedBehavior#lastSequenceNumber
Java DSL throws exception when using typed.javadsl.EventSourcedBehavior#lastSequenceNumberMay 27, 2024
For the record, Deferred means the behavior was not created yet, it just contains a factory context => behavior, so there is no way to look "inside" it.
Can you share exactly what the event handler method looks like?
When handling the first event in the event handler:
I think that pattern matching should also cover Deferred wrapper:

The text was updated successfully, but these errors were encountered: