简体   繁体   中英

Is it possible to run akka system with both transport enabled netty and artery?

Is it possible to run two applications with different transports (netty/artery) and make them communicate each other? For example: If system A is listening tcp port (netty) and system B listening udp port (artery), can we send message from B to A?

When I've tried to create an actor ref on system B like this: system.actorFor("akka.tcp://akka-2-5@127.0.0.1:2525/user/actor-2-5")

I've got error: java.lang.IllegalArgumentException: Wrong protocol of [akka.tcp://akka-2-5@127.0.0.1:2525/user/actor-2-5], expected [akka]

So, looks like I need to configure my actor systems to start with both transport systems. But how can we do this? I'm looking for a way to send messages with single actor system and different akka transports (netty or artery) as different micro-service neighbors can use different transports.

You cannot enable both artery and legacy remoting in the same ActorSystem . The only workaround I can think of is to have two actor systems, one running remoting with artery and one with legacy remoting (this can be done in the same JVM though).

Note that in general Akka remoting is not a very good protocol for inter micro service communication since it can tie separate micro services to the same binary versions of Akka, libraries and application classes and force you to do lock step upgrades (see this talk by Ben Christensen for more: https://www.microservices.com/talks/dont-build-a-distributed-monolith/ ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM