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
Copy file name to clipboardExpand all lines: docs/articles/utilities/event-bus.md
+87
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,14 @@ title: Event Bus
4
4
---
5
5
# EventBus
6
6
7
+
EventBus provides several types of custom messages to subscribe to:
8
+
9
+
1.`DeadLetter` - messages that are not delivered to actor
10
+
2.`UnhandledMessage` - messages which actor receives and doesn't understand
11
+
3.`SuppressedDeadLetter` - similar to DeadLetter with the slight twist of NOT being logged by the default dead letters listener
12
+
4.`Dropped` - messages dropped due to overfull queues or routers with no routees
13
+
5.`AllDeadLetters` - shortcut for all types of unhandled messages
14
+
7
15
## Subscribing to Dead Letter Messages
8
16
9
17
The following example demonstrates the capturing of dead letter messages generated from a stopped actor. The dedicated actor will output the message, sender and recipient of the captured dead letter to the console.
@@ -58,6 +66,85 @@ sample capture
58
66
DeadLetter captured: another message, sender: [akka://MySystem/deadLetters], recipient: [akka://MySystem/user/ExpendableActor#1469246785]
59
67
```
60
68
69
+
## Subscribing to Unhandled Messages
70
+
71
+
The following example demonstrates the capturing of unhandled messages. The dedicated actor will output captured unhandled message to the console.
// try sending a message to actor which it doesn't understand
93
+
dumbActor.Tell("Hello");
94
+
95
+
Console.ReadLine();
96
+
}
97
+
```
98
+
99
+
sample capture
100
+
101
+
```string
102
+
DeadLetter from [akka://MySystem/deadLetters] to [akka://MySystem/user/$a#965879198]: <Hello>
103
+
```
104
+
105
+
## Subscribing to AllDeadLetters Messages
106
+
107
+
The following example demonstrates the capturing of all unhandled messages types. The dedicated actor will output captured unhandled messages to the console.
0 commit comments