Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

.net의 어플리케이션 설정과 호환가능:  특이한 형태의 설정으로  JAVA/AKKA 와 설정컨셉 동일  

DJangotitle
Code Block
languagebash
theme
Panel
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
      <section name="akka" type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" />
    </configSections>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>
    <akka>
      <hocon>
        <![CDATA[     
            akka {
              actor {            
                provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
              }                           
              remote {
                log-remote-lifecycle-events = DEBUG
                log-received-messages = on
               
                helios.tcp {
                    port = 8001 #bound to a specific port
                    hostname = 127.0.0.1
                }
              }           
            }         
        ]]>
      </hocon>
    </akka>
</configuration>
Expand
코드에 직접 설정화



var config = ConfigurationFactory.ParseString(@" akka.remote.dot-netty.tcp { transport-class = ""Akka.Remote.Transport.DotNetty.DotNettyTransport,
 Akka.Remote"" transport-protocol = tcp port = 8091 hostname = ""127.0.0.1"" }");

var system = ActorSystem.Create("MyActorSystem", config);

설정은 파일로 분리되는게 좋지만, 위와같은 형식으로 설정적용도 가능합니다.

실행확인

로그의 의미:

자신이 설정한 포트(ex:8001)가  표시되면 정상이다.

...