forked from JavaWebinar/masterjava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d523782
commit 5871203
Showing
6 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
webapp { | ||
include required(classpath("akka-common")) | ||
|
||
akka { | ||
remote.netty.tcp.port = 2554 | ||
} | ||
} | ||
|
||
mail-service { | ||
include required(classpath("akka-common")) | ||
|
||
akka { | ||
remote.netty.tcp.port = 2553 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>ru.javaops</groupId> | ||
<artifactId>parent-web</artifactId> | ||
<relativePath>../../parent-web/pom.xml</relativePath> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>akka-remote</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>Akka Remote</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>common</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.typesafe.akka</groupId> | ||
<artifactId>akka-remote_2.12</artifactId> | ||
<version>2.5.8</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>com.typesafe</groupId> | ||
<artifactId>config</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.scala-lang</groupId> | ||
<artifactId>scala-library</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.scala-lang</groupId> | ||
<artifactId>scala-library</artifactId> | ||
<version>2.12.4</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
28 changes: 28 additions & 0 deletions
28
services/akka-remote/src/main/java/ru/javaops/masterjava/akka/AkkaActivator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package ru.javaops.masterjava.akka; | ||
|
||
import akka.actor.ActorSystem; | ||
import lombok.extern.slf4j.Slf4j; | ||
import ru.javaops.masterjava.config.Configs; | ||
|
||
@Slf4j | ||
public class AkkaActivator { | ||
private static final String AKKA_CONF = "akka.conf"; | ||
|
||
private ActorSystem system; | ||
|
||
private AkkaActivator(String actorSystemName, String nodeName) { | ||
log.info("Start AKKA System {} : {}", actorSystemName, nodeName); | ||
system = ActorSystem.create(actorSystemName, Configs.getAppConfig(AKKA_CONF).getConfig(nodeName)); | ||
} | ||
|
||
public static AkkaActivator start(String actorSystemName, String configName) { | ||
return new AkkaActivator(actorSystemName, configName); | ||
} | ||
|
||
public void shutdown() { | ||
if (system != null) { | ||
log.info("Akka system shutdown"); | ||
system.terminate(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
akka { | ||
actor { | ||
provider = "akka.remote.RemoteActorRefProvider" | ||
} | ||
|
||
remote { | ||
netty.tcp { | ||
hostname = "127.0.0.1" | ||
maximum-frame-size = 10000000b | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters