I'm attempting to setup a simple graph structure that process data via invoking rest services, forwards the result of each service to an intermediary processing unit before forwarding the result.
(我试图建立一个简单的图结构,该结构通过调用rest服务来处理数据,然后在转发结果之前将每个服务的结果转发给中间处理单元。)
Here is a high level architecture : (这是一个高级架构:)
Can this be defined using Akka graph streams ?
(可以使用Akka图流定义它吗?)
Reading https://doc.akka.io/docs/akka/current/stream/stream-graphs.html I don't understand how to even implement this simple architecture. (阅读https://doc.akka.io/docs/akka/current/stream/stream-graphs.html我什至不知道如何实现这种简单的体系结构。)
I've tried to implement custom code to execute functions within a graph :
(我试图实现自定义代码来执行图中的功能:)
package com.graph
class RestG {
def flow (in : String) : String = {
return in + "extra"
}
}
object RestG {
case class Flow(in: String) {
def out : String = in+"out"
}
def main(args: Array[String]): Unit = {
List(new RestG().flow("test") , new RestG().flow("test2")).foreach(println)
}
}
I'm unsure how to send data between the functions.
(我不确定如何在函数之间发送数据。)
So I think I should be using Akka Graphs but how to implement the architecture above ? (所以我认为我应该使用Akka Graph,但是如何实现上述架构?)
ask by blue-sky translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…