0

I am using akka streams. So i am having one actor with this functionality.

Both messages were getting processed in order sometimes . but due to async call (I THINK) , i am getting dead letter in this.

actor.tell(message,ActorRef.noSender()); 
actor.tell(PoisonPill.getInstance(),ActorRef.noSender())

Can anyone help how to make sure to run this code in specific order?

ThanhPhanLe
  • 1,315
  • 3
  • 14
  • 25
Mayank
  • 21
  • 2
  • They should arrive in order. Perhaps add some logging in the actor to see what's going on? – Arnout Engelen Aug 02 '19 at 09:39
  • You don't show the Akka Streams part of your code. The two above tells should get processed in order, but it's conceivable something else is stopping the actor. – David Ogren Aug 04 '19 at 10:33

1 Answers1

0

It's probably that you are getting an exception which is killing the stream. Are you using a supervision strategy? If not, I would recommend following the documentation: https://doc.akka.io/docs/akka/current/stream/stream-error.html#supervision-strategies

If it is in some async call, it might be the future is throwing a TimeoutException.

hveiga
  • 6,725
  • 7
  • 54
  • 78