Skip to content

Latest commit

 

History

History
97 lines (67 loc) · 3.62 KB

File metadata and controls

97 lines (67 loc) · 3.62 KB

AKKA

Messaging with AKKA System

goal

src:

How to send a message to an actor from another remote application

ActorSelection remoteGreeter = system.actorSelection("akka.tcp://accountapi@127.0.0.1:2552/user/greeter");
remoteGreeter.tell(new Greet("This is Remote Message"),ActorRef.noSender());

Akka Documents Summary:

  1. Local Actor
  2. Remote Actor
  3. Router
  4. Stream
  5. Cluster
  6. Akka with Any Stream

Akka Remote

RemoteActor works similarly to LocalActor and is scalable.

more info : https://getakka.net/articles/Remoting/ - It is described in .net code, but it is the same as the concept of java.

image

related src:

Actor Config for Remote

akka {
  actor {
    provider = remote
  }
  remote {
    enabled-transports = ["akka.remote.netty.tcp"]
    netty.tcp {
      hostname = "0.0.0.0"
      port = 2552
    }
  }
}

RemoteTest

@Test
public void testIt() {
    new TestKit(system) {{
        ActorRef probe = getRef();
        ActorSelection accountGreeter =
                system.actorSelection("akka.tcp://accountapi@0.0.0.0:2552/user/greeter");

        accountGreeter.tell(new CMD_REMOTE(5,"hi"),getRef());
        String expectMessage = expectMsgClass(Duration.ofSeconds(5),CMD_REMOTE.class).getMessage();
    }};
}

Cluster

image

related src:

Akka with DDD

Spring has a web total solution, and AKKA has a total solution for message processing. It may be a difficult attempt to harmonize the two things, but it will be a good experience and we will prepare some samples.

Akka Monitoring and Telemetry

image

Compare with Other

  • Spring Boot with DDD : preparing....
  • KAFKA Stream with DDD : preparing....