We have built lots of code around using Akka-Http within a single node. I’m trying to see if I can scale it out by using Akka-Cluster and send the Http requests to a remote worker Actor. I know that it is probably better to perform all Akka-Http stuff locally and then send the payload to a remote worker Actor. Unfortunately, it would be way easier if I can send the whole RequestContext and get back a Route. I cannot serialize it fully:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Direct self-reference leading to cycle (through reference chain: ClusteredApiProcessor$RequestContextCommand["requestContext"]->akka.http.scaladsl.server.RequestContextImpl["request"]->akka.http.scaladsl.model.HttpRequest["entity"]->akka.http.scaladsl.model.HttpEntity$Strict["dataBytes"]->akka.stream.javadsl.Source["delegate"]->akka.stream.scaladsl.Source["traversalBuilder"]->akka.stream.impl.LinearTraversalBuilder["outPort"]->akka.stream.Outlet["mappedTo"])
I’m guessing the entity Stream is not friendly towards this? Is there a way to a) extractEntityLocally and then send RequestContext mapping in a null for the entityStream? Anyone else attempted something similar to marry Akka-Http with Akka-Cluster?
Thanks much