-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deadletter as an actor #64
Conversation
Ok. Some more progress. It's now possible to pass a custom actor to deal with dead letters. It's like this:
newCustomDeadLetter returns the receiver. The engine will call this during init and set the handler. This is quite flexible, I think. A custom deadletter receiver could look like this:
|
Quite a few tests are currently failing as a lot of the existing test code seems to touch stuff that has been changed. |
a) the deadletter process will print out the msg IMO there is no way to flush the deadletter process / actor. I think it should be throttled though. I'm looking into the failing tests. We expect (now) that when a process is not found the deadletter process will be returned, right now you are returning nil. |
Thanks for looking into it. The reason I changed the return value to return a nil was so that we can explicitly handle the deadletter situation, so we wrap the message in a DeadLetterEvent. I'll simplify the dead letter handling so it'll only print a warning and not keep any state. I'll also remove the Flush and Request events so we keep it dead simple. |
wrt to b), what do you think the default behaviour should be? As it stands now deadletter is just another actor, so AFAIK there isn't any eventstream connected (unless there is some magic I don't know about). I've not used eventstreams so far, so I'm sure what to think about it. Should I create an manage an eventstream from the deadletter actor or should that be up the user to handle? |
…the user can supply their own dead letter handling if they need to.
…hese two tests needed to change.
@perbu You have a point on the event stream that is not connected though :). This means that the Good job again. I will look into the changes today and merge. |
@perbu I guess the merging the graceful poison, conflicts. Can you fix? :) |
reality where registry/get returns nil if there is no actor.
ready to merge again. |
I thought I'd get a bit into the weeds and looked at what it would take to make the deadletter handling an actor (receiver).
I have made some progress, the initial stuff is there, but if possible, I'd like some feedback before I spend more time on it.
The nice thing here is that it, if we do this right, it would be simple to supply an actor to do the deadletter handling. The downside is that it seems to break quite a few assumptions in the tests. It wasn't as simple as I thought. :-)
Questions:
Answer: I have an implementation in place. It's a bit hacky, see engine.go where the options are handled.
Answer: I implemented this. Messages are wrapped in DeadLetterEvent before being sent to the receiver.