These are chat archives for akkadotnet/akka.net

21st
Sep 2016
eriklagerholm
@eriklagerholm
Sep 21 2016 08:03

Hello! Is anyone else having trouble with setting a connectionstring name in the config for Persistence.SqlServer? My system works if I put the entire connectionstring value in the HOCON, but referencing a registered connectionString by name is not working for me. I'm getting some strange silent failure where my persistent actors just stop processing right before the call to Persist(). No errors in the log. Just quietly stops processing. This is my current config:

akka : { stdout-loglevel : DEBUG loglevel : DEBUG log-config-on-start : on loggers : ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"] actor : { debug : { receive : on autoreceive : on lifecycle : on event-stream : on unhandled : on } } persistence : { journal : { plugin : akka.persistence.journal.sql-server sql-server : { class : "Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer" plugin-dispatcher : akka.actor.default-dispatcher connection-string-name : NotificationServiceEventJournal connection-timeout : 30s schema-name : dbo table-name : EventJournal auto-initialize : on timestamp-provider : "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common" metadata-table-name : Metadata } } } }

I'm happy to provide more info if needed. Thanks in advance!

Bartosz Sypytkowski
@Horusiath
Sep 21 2016 09:19
@eriklagerholm config looks fine for me
(ofc counting that it's not actual HOCON, but runtime stringified representation)
eriklagerholm
@eriklagerholm
Sep 21 2016 09:54
Ok, so if this config is fine then something outside (in my Web.config or ConnectionString.config) might be wrong. But the framework should emit some form of error if the ConnectionString is bad or null, right?
Thomas Lazar
@thomaslazar
Sep 21 2016 10:14
Damn... I'm currently at a conference and the presenter is giving a introduction talk about akka.net... and im thinking about leaving...
Thomas Lazar
@thomaslazar
Sep 21 2016 10:37
And looking at the audience about 80% tilted out...
Arjen Smits
@Danthar
Sep 21 2016 10:47
@thomaslazar that sucks man :P. Looks like its the first session after lunchtime ? Those are always hard imho.
Thomas Lazar
@thomaslazar
Sep 21 2016 10:51
Nah. Was before lunch.
Was a complete dud. And he was claiming stuff about the change to wire that were plainly not true. Among other things.
Arjen Smits
@Danthar
Sep 21 2016 10:53
:/ not good press then
Thomas Lazar
@thomaslazar
Sep 21 2016 10:53
Just know if I didn't have any clue about akka.net or actors this talk wouldn't have enlightened me.
Arjen Smits
@Danthar
Sep 21 2016 10:53
In a few weeks im going to a conference which also has a talk on akka.net. I wonder how that will go
Thomas Lazar
@thomaslazar
Sep 21 2016 10:54
He didn't even bother to remember the name Petabridge and other stuff. But I don't like this presenter much anyways. Too full of himself.
Bartosz Sypytkowski
@Horusiath
Sep 21 2016 10:54
I'm having a one tomorrow ;) It's using an unconference rules - wondering how this will turn
Arjen Smits
@Danthar
Sep 21 2016 10:55
Well sometimes conferences have ways to rate or give feedback on talks
be sure to use that then ;)
@Horusiath unconference rules ? whats that
Bartosz Sypytkowski
@Horusiath
Sep 21 2016 10:56
Typically at an unconference, the agenda is created by the attendees at the beginning of the meeting. Anyone who wants to initiate a discussion on a topic can claim a time and a space. Unconferences typically feature open discussions rather than having a single speaker at the front of the room giving a talk, although any format is permitted. This form of conference is particularly useful when the attendees generally have a high level of expertise or knowledge in the field the conference convenes to discuss.
so it's like a freestyle discussion
something very hard to feel prepared for
Arjen Smits
@Danthar
Sep 21 2016 10:57
sounds daunting
well... actually..
if you have done alot of technical talks before. you can simply lean on that experience and borrow stuff from those talks i suppose
Bartosz Sypytkowski
@Horusiath
Sep 21 2016 11:01
this time rules are different - I think that to make an open discussion a subject cannot be highly technical/specific - people are more talkative in more abstract topics they can relate to from their own point of view (i.e. topic I was thinking about was about building open source projects)
Thomas Lazar
@thomaslazar
Sep 21 2016 11:02
Tomorrow there's an WPF application with Akka.net talk. Hopefully the is a bit better.
Peter Bergman
@peter-bannerflow
Sep 21 2016 11:25
Another Akka.TestKit question, if I have an actor under test, can I somehow assert that this actor receives a certain message. For example, I have and actor which is supposed to schedule a message to itself, can I assert this in a test?
Peter Bergman
@peter-bannerflow
Sep 21 2016 11:38
Or, is there a possibility to assert that an actor emits a certain message?
eriklagerholm
@eriklagerholm
Sep 21 2016 11:48
This message was deleted

@peter-bannerflow

You can assert that your actor under test responds to a certain message with some other message. Is that what you are going for?

public void GivenSomeMessage_ThenSomeOtherMessage {
    var sut = Sys.ActorOf(Props.Create(() => new SomeActor()));

    sut.Tell(new SomeMessage());

    ExpectMsg<SomeOtherMessage>();
}
Peter Bergman
@peter-bannerflow
Sep 21 2016 11:52
Yeah, thats not really what I am aiming for. In my case, the actor under test will send a message to itself, so I can't really expect a message back to the temporary TestActor
eriklagerholm
@eriklagerholm
Sep 21 2016 11:53
Ok, maybe you can test for the effect of the Self-message. If there is a state change then you could try testing for that.
Peter Bergman
@peter-bannerflow
Sep 21 2016 11:55
There is and I was thinking about that also even if asserting that the state changes feels like another test on its own, but that also means that I have to make my internal state public so that I can access it directly in tests
Bartosz Sypytkowski
@Horusiath
Sep 21 2016 11:55
@peter-bannerflow maybe it's not worth testing itself? It's like testing private method. Focus on testing actor's actions and reactions, not how they are achieved
Peter Bergman
@peter-bannerflow
Sep 21 2016 11:56
True, that is kind of what I am doing now so maybe I should just leave it as it is :)
eriklagerholm
@eriklagerholm
Sep 21 2016 12:02
I agree with @Horusiath, good point.
If you want to test for state changes, state being in relation to switchable handlers with Become() etc, then I found using the test probe and event stream quite handy. By subscribing the test probe to the event stream you can assert that given a certain message or event or whatever, then an Unhandled message will be sent to the test probe.
Peter Bergman
@peter-bannerflow
Sep 21 2016 12:17
@eriklagerholm That does sound interesting, will check it out, thanks
eriklagerholm
@eriklagerholm
Sep 21 2016 12:46
And I now realize I got the tip from mr Horusiath :) Check out the first answer: http://stackoverflow.com/questions/30730706/how-to-use-testkit-in-akka-net
Peter Bergman
@peter-bannerflow
Sep 21 2016 13:29
While we are at the subject of TestKit... I've been trying controlling the scheduling by using a TestScheduler so I can do things such as Scheduler.Advance. However, using the TestScheduler seem to mess up things that I schedule inside my actor under test. For example, I have a scheduled tell inside the PreStart of my actor which never seem to trigger. Has anyone experienced something similar?
Aaron Stannard
@Aaronontheweb
Sep 21 2016 22:23
@peter-bannerflow yeah there are some known issues with that
where the test scheduler doesn't correctly advance and trigger things
I don't recall exactly what the scenarios are where that can occur
one of the common ones is that developers do two calls in a row like this
  1. start actor
  1. advance scheduler immediately
the first part, the actor starting, is asynchronous
so the actor's schedule call can be executed after the advance
since they're happening on separate threads
one way to fix that is to use the CallingThreadDispatcher at the same time as the TestScheduler: akkadotnet/akka.net#1417
this forces the actor to run on the same thread as the unit test
Aaron Stannard
@Aaronontheweb
Sep 21 2016 22:28
@thomaslazar @Danthar which conference is this?
it's awesome to see a bunch of Akka.NET talks sprouting up, although I'm sorry to hear that one wasn't so good
1.1.2 release should be going out today folks... waiting on CI to do its thing