These are chat archives for akkadotnet/akka.net

3rd
Oct 2016
eriklagerholm
@eriklagerholm
Oct 03 2016 09:41
In a microservices architecture, surely Akka.net would be a good choice for implementation of an API Gateway, right? Handling concurrenct service calls, managing errors, scaling etc. Reading about the responsibilities of an API Gateway, all my currently Akka-infused mind is telling me is: go! But are there any obvious pitfalls that I should be aware of? Anyone in here currently doing something like this?
Arsene Tochemey GANDOTE
@Tochemey
Oct 03 2016 09:44
@eriklagerholm Have you looked at the Petabridge tutorial : https://github.com/petabridge/akkadotnet-code-samples/tree/master/Cluster.WebCrawler. I believe it can be of a good help for your decision
eriklagerholm
@eriklagerholm
Oct 03 2016 10:17
Not in depth, no. Thanks, I'll take a look.
verysimplenick
@verysimplenick
Oct 03 2016 13:48
hi, can help me to understand Logging system?
Bartosz Sypytkowski
@Horusiath
Oct 03 2016 13:49
@verysimplenick what do you need to know?
verysimplenick
@verysimplenick
Oct 03 2016 13:49
I see that Akka.Logger.NLog.NLogLogger is a actor that implements IRequiresMessageQueue<ILoggerMessageQueueSemantics> why not implement ILoggingAdapter?
Bartosz Sypytkowski
@Horusiath
Oct 03 2016 13:50
because ILoggingAdapter is a facade to be used for sending log messages not the logger itself
you can have multiple different logging providers working at the same time if you want, and still communicate with all of them using single loggingAdapter
verysimplenick
@verysimplenick
Oct 03 2016 13:52
Okay. I have my interface with name ILog, have adapters something like this: NLogAdapter : MarshalByRefObject, ILog, this logging object I transfer across AppDomains, I want make Akka actors, that use this object, what I need to do?
I can create some logging adapter with non-default ctor?
Bartosz Sypytkowski
@Horusiath
Oct 03 2016 13:53
why would you do that? Isn't easier to just create your own logger and plug it in?
verysimplenick
@verysimplenick
Oct 03 2016 13:55
I mean that I use some object in parent AppDomain and child, and want something like NLogAkkaAdapter : NLogAdapter, ILoggingAdapter that use my log object, but I need config Akka.net to use my NLogAkkaAdapter in new AppDomain, and init this class with proxy-object from parent appDomain.
ye, I need help, can't find how init logger for akka from code
not from App.config
something like actorSystem.LogActor=
Bartosz Sypytkowski
@Horusiath
Oct 03 2016 13:57
it's an example of custom logger using SignalR hub as a log sink
verysimplenick
@verysimplenick
Oct 03 2016 13:58
sec, read
yep, same problem, I want use my object for internall Akka.net logging+actor logging, I can create actor like you, but can be used only in local actor system scope, it's not replacement for actorSystem.Log as I can see.
Bartosz Sypytkowski
@Horusiath
Oct 03 2016 14:04
you won't access actorSystem.Log because as I said, there is no such thing, you have only actors, and each one of them can have it's own "Log"
and note about locality is to not try to send SignalR Hub between actor systems, as this will fail, because unlike IActorRefs, signlar hubs are not transparent between OS processes
verysimplenick
@verysimplenick
Oct 03 2016 14:08
maybe I don't understand concept. What I need : 2 appDomains use same object for Logging , Actors in child AppDomain need to use same Logger, if can I wanna init this by Akka.net config. If this impossible => I known that I need just implement own ReceiveActor and use it
Bartosz Sypytkowski
@Horusiath
Oct 03 2016 14:10
I don't even now if it's possible to share the same exact object between app domains, and not sure why do you need it for
verysimplenick
@verysimplenick
Oct 03 2016 14:10
by MarshalByRefObject
I can give some object to ctor logging actor? (loggers = ["Actors.TestLoggingActor,MyAssembly"] <-- want not default ctor for this)
Bartosz Sypytkowski
@Horusiath
Oct 03 2016 14:11
marshalbyrefobject is not sharing the same object, it's marshalling it (aka. "serializing")
verysimplenick
@verysimplenick
Oct 03 2016 14:11
yep, by proxy object
it's fine for me
I need place something to ctor default Logger or something code for replace logger after I create ActorSystem
Bartosz Sypytkowski
@Horusiath
Oct 03 2016 14:12
unfortunately you cannot pass objects to log actors, you can pass initialization message to them
but still using marshalbyref looks like some hack rather than solution
verysimplenick
@verysimplenick
Oct 03 2016 14:13
oh, good, How I can pass message?
Receive<InitializeLogger>(m => here?
Bartosz Sypytkowski
@Horusiath
Oct 03 2016 14:14
read the link, I've send you - there I'm passing signalr hub to logger as part of RegisterHub message
verysimplenick
@verysimplenick
Oct 03 2016 14:23
thanks
        _system = ActorSystem.Create("logging-system", 
            ConfigurationFactory.ParseString(@"akka.loggers = [""MyNamespace.BrowserLogger, MyAssembly""]"));
        _logger = _system.ActorSelection("/system/log*");
that I need :)