Using akka http to bind to a port and then route incoming connections is easy enough given the documentation.
One question not addressed is how to bind multiple ports for different routes. If I have multiple specifications:
val route1 : Flow[HttpRequest, HttpResponse,_] = ???
val interface1 : String = ???
val port1 : Int = ???
val route2 : Flow[HttpRequest, HttpResponse,_] = ???
val interface2 : String = ???
val port2 : Int = ???
Should these be bound with one HttpExt
?
implicit val actorSystem : akka.actor.ActorSystem = ???
val httpExt = akka.http.scaladsl.Http()
httpExt.bindAndHandle(route1, interface1, port1)
httpExt.bindAndHandle(route2, interface2, port2)
Or, should a different HttpExt
be used for each bind?
Http().bindAndHandle(route1, interface1, port1)
Http().bindAndHandle(route2, interface2, port2)
If either is valid, then are there any implications for using one method over the other?
Thank you in advance for your review and response.