These are chat archives for akkadotnet/akka.net

11th
Dec 2018
Shukhrat Nekbaev
@snekbaev
Dec 11 2018 00:17
@mikebridge absolutely, if that works best for your scenario, definitely. I needed a reply for the .Ask call initiated from the WebApi's side. Also I thought that using the same approach I could have a pub/sub for certain potential future scenarios without using/adding any other technologies, but that's open to R'n'D tbh.
Dan Albrecht
@Dan-Albrecht
Dec 11 2018 03:22
Anyone have an example of code doing config substitution? I just have markers in the config file right now and doing a find/replace before passing it to ConfigurationFactory.ParseString...gotta be doing it wrong.
Bartosz Sypytkowski
@Horusiath
Dec 11 2018 06:47
@snekbaev sorry, but I don't have an obvious answer for you. What I can think of in your scenario is to use ClusterClient from Akka.Cluster.Tools to connect web app as clients and hook to you web application lifecycle to order it to shutdown gracefully (via ActorSystem's Shutdown).
Bartosz Sypytkowski
@Horusiath
Dec 11 2018 06:58
@Dan-Albrecht depending on how massive these substitutions are:
  • if I'm right ${ENV_VAR} should work with environment variables substitutions by now
  • if I need to sustitute few config values from code, I'm just building a HOCON string directly in code (lame I know, but we're working on making dynamic in-code configs possible)
  • if I need to substitue a lot (like dev/prod), I just have my-project.dev.conf and my-project.prod.conf and depending on the build specifics I'm loading one file or another.
AndreSteenbergen
@AndreSteenbergen
Dec 11 2018 10:53
@angrybug ah that does make sense
Shukhrat Nekbaev
@snekbaev
Dec 11 2018 12:45
@Horusiath thank you for your reply. For that I will need to start using clustering in this stand-alone VM's service, that's the downside, but the upside is the cluster client (coming from WebAPI) will be able to connect directly to it and cluster itself will never try to connect to the client, thus disassociation will never happen. Is my understanding correct? And two more questions: what happens if WebAPI won't gracefully shutdown its cluster client? And do you happen to remember some good example you can point to that deals with akka io. I made own version which is a hybrid of docs + your blog post. Seems to be working ok, just want to make sure I'd handling/disposing things correctly. For example, when shutting down the server part, I'm getting the deathpactexception coming from the ReceiveListener and some deadletters with SocketEventArgs or something like that
Dan Albrecht
@Dan-Albrecht
Dec 11 2018 20:21
Thanks @Horusiath . We currently have 15 environments, so want to avoid going down the one file per env route. Will play around with having a single shared defaults file and constructing a HOCON string in code for the per-environment stuff and slapping them together with WithFallback. Was initially opposed to doing environment variables, because I'd have to write code to set the environment variables, but that might be the cleanest solution...