These are chat archives for akkadotnet/akka.net

7th
Aug 2015
Anthony Brown
@bruinbrown
Aug 07 2015 00:01
@AlanGRutter yep good call
Alan Rutter
@AlanGRutter
Aug 07 2015 00:03
@bruinbrown - thanks for the help. I need to send a login request but there is no indication returned when the request failed (only an event raised when the login succeeds). What's the best way to handle this with Akka - I need to retry the request somehow.
Anthony Brown
@bruinbrown
Aug 07 2015 00:13
So it sounds like there's a timeout involved where if the events not been raised within x seconds you need to retry. You could either schedule a message to retry with System.Scheduler or use ReceiveTimeout as an alternative. I'd probably go for the first option but research the other as well
Alan Rutter
@AlanGRutter
Aug 07 2015 00:22
@bruinbrown - haven't got to that in bootcamp yet, but will do some research. Probably trying to run before walking! Thanks for pointing me in the right direction.
Aaron Stannard
@Aaronontheweb
Aug 07 2015 01:05
@rogeralsing I'm going to file a bug for that and then send a PR along shortly
John Haigh
@haighis
Aug 07 2015 03:07
@Aaronontheweb i submitted PR akkadotnet/hocon#7
Aaron Stannard
@Aaronontheweb
Aug 07 2015 03:45
@haighis sure thing - I'll take a look shortly. Working on a bunch of CI stuff for Akka.Persistence at the moment so we can try to get this 1.0.4 release out :(
Hyungho Ko
@hhko
Aug 07 2015 04:36
blob
how to get the nLog instance from Context.GetLogger?
Aaron Stannard
@Aaronontheweb
Aug 07 2015 04:37
you want to access the underlying NLog logger?
Hyungho Ko
@hhko
Aug 07 2015 04:37
how_to_get_nlog.png
Aaron Stannard
@Aaronontheweb
Aug 07 2015 04:38
@hhko the NLog logger will pick that up - it's wrapped inside an actor
the akka.EventBusLogging is the proxy that publishes log messages to all of the logging actors
in case you have multiple log sources enabled
are you not seeing output from NLog to your targets (console, file, etc...) ?
Hyungho Ko
@hhko
Aug 07 2015 04:43
thank you for your consideration. and Can I get the example for using NLog ?
there is not the examples for loggers on akka.net git.
Aaron Stannard
@Aaronontheweb
Aug 07 2015 04:44
@hhko I actually use it here in my Lighthouse project https://github.com/petabridge/lighthouse/blob/master/src/Lighthouse/App.config
Hyungho Ko
@hhko
Aug 07 2015 04:45
thank you.
Aaron Stannard
@Aaronontheweb
Aug 07 2015 04:45
@hhko just created this issue for our documentation website: akkadotnet/getakka.net#106
that's a good point you made - we should have examples on this
@rogeralsing so one thing I'm noticing - it looks like there were some major changes in JSON.NET 7
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:10
@rogeralsing ok, phew - I was worried for a sec. Ran into a ton of issues with apps that were compiled against JSON6 not working with JSON7, but that must have been the way those were installed
if you upgrade to the latest JSON.NET from nuget the binding redirect that it adds works
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
I was worried that they had changed a bunch of public interfaces or something, which a binding redirect can't fix
but looks like that's not an issue
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:17
was checking to make sure our upgrade to JSON.NET 7 didn't hurt our ability to be compatible with earlier versions of ASP.NET
everything looks good
tried it out against webcrawler
@Horusiath got CI up and running for Akka.Persistence.Sqlite: akkadotnet/Akka.Persistence.Sqlite#3
have some work to do in the morning to set up nightlies and release builds for all of these. I have a PR in for all 5 of the Akka.Persistence implementations that I need someone to review. if it looks good for one project it should be good for all of them
it'll allow us to do an integration build every night against the latest nightly Akka.Persistence package for each of the Akka.Persistence.* projects
so if you make some changes to the Akka.Persistence.TestKit, it'll automatically be integration tested against all of those projects each night
that should be fun to watch :p
since it'll fire up like 5 builds at once
I made nLog examples...^^;
thank you...^^;;;
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:24
@hhko you are awesome!
Joe Flood
@jfloodnet
Aug 07 2015 05:26
any guidance/tricks for dealing with time in the TestKit ?
any way of eliminating the problem all togethor?
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:44
@jfloodnet we have a virtual time scheduler in the new version coming out - @sadprofessor wrote it IIRC
but in general what seems to be the trouble?
Joe Flood
@jfloodnet
Aug 07 2015 05:45
wow my test passed
lol
i think my main problem at this stage is im probably writing a larger end to end scenario that involves a couple of scheduled messages within the actor
the way im managing it is by tweaking the durations from the test to be milliseconds
but feels brittle
id like to be able to do things like "freeze" time
or advance time
but maybe im not breaking the problem small enough
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:47
the virtual time scheduler is what you want then
that's exactly what it does
Joe Flood
@jfloodnet
Aug 07 2015 05:48
yea cool - i want that :)
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:48
it'll be available in the 1.0.4 release
which I've been trying to do since Tuesday :p
Joe Flood
@jfloodnet
Aug 07 2015 05:48
oh - ok ill get out of your way :P
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:48
but it's taken a bit longer than I expected to get all of the CI stuff
nah man you're not bothering me - I'm done working on that stuff for tonight
happy to help
Joe Flood
@jfloodnet
Aug 07 2015 05:49
thanks man
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:50
akkadotnet/akka.net#1137
if you install the latest nightly build of Akka.NET you should be able to use that
Joe Flood
@jfloodnet
Aug 07 2015 05:50
looks the goods, cheers!
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:51
you're welcome! we still need docs for that sucker, so if you have a good experience with it consider sending a PR to https://github.com/akkadotnet/getakka.net ;)
Joe Flood
@jfloodnet
Aug 07 2015 05:52
ok - that might be a good place to start for me ;)
Aaron Stannard
@Aaronontheweb
Aug 07 2015 05:54
we still need docs for most of the testkit, actually :(
Joe Flood
@jfloodnet
Aug 07 2015 05:56
yea im actually struggling with a few concepts in it
not sure what the Latches and Barriers do?
or how to use them? any examples in akka?
i find the akka dsl quite useful for testing though-
for instance when the a test actor sends a messge to the parent
nice way, is to wrap it in an inline actor to receive the message
(not sure if there is a better way built in though)
e.g.
'' Sys.ActorOf((act, ctx) =>
{
//Propagates messages sent to Context.Parent.Tell in child actors to the TestActor
//This allows us to "ExpectMsg" for message that are sent to Parent
act.ReceiveAny((m, _) => TestActor.Tell(m));
            configure(act, ctx);
        });
damnit
        Sys.ActorOf((act, ctx) =>
        {
            //Propagates messages sent to Context.Parent.Tell in child actors to the TestActor
            //This allows us to "ExpectMsg" for message that are sent to Parent
            act.ReceiveAny((m, _) => TestActor.Tell(m));

            configure(act, ctx);
        });
yay
Bartosz Sypytkowski
@Horusiath
Aug 07 2015 07:25
@Aaronontheweb these persistence plugins test failures sound really bad. We should go for them ASAP
Damian Reeves
@DamianReeves
Aug 07 2015 10:08
Quick question on Akka.IO: am I correct in saying it enables direct TCP communication to Actor system? Does this mean I can talk to Akka from a .NET 4 client?
Bartosz Sypytkowski
@Horusiath
Aug 07 2015 10:28
@DamianReeves yes. I've created a sample project in core repo, which you may call using telnet from cmd
Damian Reeves
@DamianReeves
Aug 07 2015 10:29
@Horusiath Thanks, I'll take a look
Ryan Davis
@rdavisau
Aug 07 2015 11:05
Is there a way for me to test what actors in the system match an actor selection?
Bartosz Sypytkowski
@Horusiath
Aug 07 2015 11:09
@rdavisau read this, I think that the part most interesting to you is example using Identify/ActorIdentity messages
Patrick Kelly
@featuresnap
Aug 07 2015 11:10

I'm somewhat confused on the best way to use dependency injection with actors. I see how we can use System.DI().Props<TActor>() to get a top-level actor. I've also seen that a top-level actor can create children who have dependencies using Context.DI().Props<TChild>(). However, I'm concerned about the impact on testability, as now in order to test the parent, my unit test has to arrange a suitable DI container with all of the dependencies required by any of the children.

It seems like a smell for a parent actor to contain an explicit nod to the existence of DI to resolve its children, and although I have no immediate use case for the use of remote actors, I'm concerned that the explicit use of Context.DI().Props() could make it impossible later on to easily convert children into remote actors.

My next thought is to maybe have the parent's constructor take Props arguments for each of the children it needs to create; however, I am really confused on whether I'd have to register Props instances for child actors in the DI container (and whether, in the case of Unity, that would interfere with the purpose of the "Child Container" concept used to tear down actor dependencies ).

Any advice would be appreciated.

Marcus Baffa
@mvbaffa
Aug 07 2015 11:28
Hi, I have a WCF Service, when the service is called I need to send a message to actor and wait for the response message. I am using the Ask patterns. Is there a better way to do this?
Ryan Davis
@rdavisau
Aug 07 2015 11:30
@Horusiath thanks, I was getting close!
Suhas Chatekar
@schatekar
Aug 07 2015 11:49
@featuresnap agree with you. I have burned my fingers several times trying to configure a DI container differently for tests than for real code. My ideal test environment would be where I would not have to reference DI containers at all
Arjen Smits
@Danthar
Aug 07 2015 11:52
@mvbaffa the Ask pattern is the recommended way of doing this.
Bartosz Sypytkowski
@Horusiath
Aug 07 2015 12:00

@schatekar let me fix your statement :P

My ideal test environment would be where I would not have to reference DI containers at all

Roger Johansson
@rogeralsing
Aug 07 2015 14:00
Can we have some eyes over at the new HOCON repo too? trying to improve the error reporting in the hocon parser. see akkadotnet/HOCON#15
Any suggestion on how to make the error more clear would be great
Sean Gilliam
@sean-gilliam
Aug 07 2015 15:05
@rogeralsing akkadotnet/HOCON#15 that looks great :thumbsup:
Marcus Baffa
@mvbaffa
Aug 07 2015 15:32
@Danthar With the Ask Pattern I have to start a new thread. What I would like to avoid is to open new processor threads, the cost is too high. Akka Actors are more lightweight. I wonder if there is another way
Aaron Stannard
@Aaronontheweb
Aug 07 2015 15:57
@featuresnap yeah, we've had a lively discussion about this recently. We found out that a lot of DI containers out of the box support behavior that isn't ideal for actors under any environment: #942
@nvivo had an idea for a prototype to make it transparent
part of the problem is we'd probably have to merge DI.Core into the central repository
since DI is a plugin, it has to get exposed somewhere
Aaron Stannard
@Aaronontheweb
Aug 07 2015 18:05
@mvbaffa if you don't want to use Ask + block, you can use async / await with Ask inside that actor
that actor won't process any new messages until the Ask operation completes and it won't block a thread
@Horusiath I agree - I contacted @LukeTillman about the Cassandra one. Going to reach out to David about the Postgres stuff
in the meantime, do you have any issue with the PRs I sent in? need the modifications in those FAKE scripts to do releases
Aaron Stannard
@Aaronontheweb
Aug 07 2015 19:51
@Horusiath did you get a chance to see my questions on #1203 ?
just wanted some clarification on those the otherwise I can merge in that PR and start on the 1.0.4 release
Roger took care of pulling in the build system stuff I needed for all of the persistence plugins
Bartosz Sypytkowski
@Horusiath
Aug 07 2015 19:56
@Aaronontheweb I just added two comments
Aaron Stannard
@Aaronontheweb
Aug 07 2015 19:57
@Horusiath thanks, so just so I understand correctly - there's some instances where FsPickler has to do serialization because it's specific to F# syntax / structures?
ok yeah, that's what it reads like
Aaron Stannard
@Aaronontheweb
Aug 07 2015 20:02
cool I'll merge it in and include it in this release
Bartosz Sypytkowski
@Horusiath
Aug 07 2015 20:35
@Aaronontheweb sorry, but I wouldn't be so responsive today
but yes, basically we use FsPickler for everything related to F# expression serialization - it's probable that this could be achieved with JSON, but to serialize whole AST tree into this kind of format would produce message of enormous size
Marcus Baffa
@mvbaffa
Aug 07 2015 20:39
@Aaronontheweb In the WCF Service I am calling an async like this IssuerAccountVO vo = Task.Run(() => GetNextIssuerAccountMessage(new GetNextIssuerAccountMessage(routerActor, numOfMessage))).Result;
Evert Mulder
@evertmulder
Aug 07 2015 22:21
Using Akka.IO I try to implement a automatic reconnect system when a connection is lost. When the connection is lost I stop the actor and schedule the recreation of the actor. This sometime throws the following exception '''csharp[ERROR][8/7/2015 10:14:42 PM][Thread 0011][akka://sinktcp/system/$b/$b] An itemwith the same key has already been added.
Cause: System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boo lean add) at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
at Akka.IO.SimpleDnsCache.Cache.Put(Resolved answer, Int64 ttl)
at Akka.IO.SimpleDnsCache.Put(Resolved r, Int64 ttl)
at Akka.IO.InetAddressDnsResolver.Receive(Object message)
at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
at Akka.Actor.ActorCell.ReceiveMessage(Object message)
at Akka.Actor.ActorCell.Invoke(Envelope envelope)'''
Aaron Stannard
@Aaronontheweb
Aug 07 2015 22:22
@evertmulder looks like a bug inside the SimpleDnsCache then
that would do it
This message was deleted
probably need to change that line to
_cache[answer.Name] = new CacheEntry(answer, until);
that would make it idempotent
Evert Mulder
@evertmulder
Aug 07 2015 22:25
Thanks. I will try to look into this.
Aaron Stannard
@Aaronontheweb
Aug 07 2015 22:29
thanks for finding it - I'd encourage you to send in a PR! ;)
Aaron Stannard
@Aaronontheweb
Aug 07 2015 22:45
holy crap the merge into master for 1.0.4 is a dousy....
Ryan Davis
@rdavisau
Aug 07 2015 22:45
:shipit:
Aaron Stannard
@Aaronontheweb
Aug 07 2015 22:46
we can thank #998 for that
Andrew Skotzko
@skotzko
Aug 07 2015 22:52
Clustering docs just published: http://getakka.net/docs/#akka-cluster
Ryan Davis
@rdavisau
Aug 07 2015 22:53
:clap:
Ryan Davis
@rdavisau
Aug 07 2015 23:36
Hey, I'd like to have a crack at petabridge/lighthouse#10. In terms of command line configurability, are we thinking it's allowing you to specify a few core parameters (stuff like things like actorsystem, port, public-hostname, seed-nodes and roles) against a standard 'helios.tcp` setup, or something more comprehensive?
Aaron Stannard
@Aaronontheweb
Aug 07 2015 23:41
@rdavisau nope, that's about it
you going to go with making a Chocolatey package?
Ryan Davis
@rdavisau
Aug 07 2015 23:46
Haven't thought about those parts yet, I was going to nail the command line bit first and hopefully learn about Cluster in the process; then discuss steps two and three :star2:
Aaron Stannard
@Aaronontheweb
Aug 07 2015 23:47
sounds good