Represents an UnhandledMessage that was not handled by the Recipient.
예제 #1
0
            private static Debug ToDebug(UnhandledMessage message)
            {
                var msg = string.Format(CultureInfo.InvariantCulture, "Unhandled message from {0} : {1}",
                                        message.Sender.Path, message.Message);

                return(new Debug(message.Recipient.Path.ToString(), message.Recipient.GetType(),
                                 msg));
            }
예제 #2
0
            private static Debug ToDebug(UnhandledMessage message)
            {
                // avoid NREs when we have ActorRefs.NoSender
                var sender = Equals(message.Sender, ActorRefs.NoSender) ? "NoSender" : message.Sender.Path.ToString();

                var msg = string.Format(
                    CultureInfo.InvariantCulture, "Unhandled message from {0} : {1}",
                    sender,
                    message.Message
                    );

                return(new Debug(message.Recipient.Path.ToString(), message.Recipient.GetType(), msg));
            }
예제 #3
0
        public void BeAbleToLogUnhandledMessages()
        {
            using (var system = ActorSystem.Create("EventStreamSpecUnhandled", GetDebugUnhandledMessagesConfig()))
            {
                system.EventStream.Subscribe(TestActor, typeof(Debug));

                var msg = new UnhandledMessage(42, system.DeadLetters, system.DeadLetters);

                system.EventStream.Publish(msg);

                var debugMsg = ExpectMsg<Debug>();

                debugMsg.Message.ToString().StartsWith("Unhandled message from").ShouldBeTrue();
                debugMsg.Message.ToString().EndsWith(": 42").ShouldBeTrue();
            }
        }