Hi Tim,


On Mon, Nov 23, 2015 at 8:55 AM, <[email protected]> wrote:

> Greetings,
>
> I am trying to improve the reliability of a client which uses Akka HTTP to
> contact a HTTPS service with multiple DNS A records. While setting
> "sun.net.inetaddr.ttl" to a low value at JVM start is a potential work
> around, ideally I'd like to replicate modern web-browser behaviour, so that
> in the event connecting to the first A record's IP address does not succeed
> the next in the list is tried until a connection is made or the list is
> exhausted.
>
> To do this and also have HTTPS work correctly, I believe I need to be able
> to specify either both the remote IP address and the hostname, or a
> resolved InetAddress instance. As far as I can tell though, neither option
> is possible with the Akka HTTP client API. The InetAddress instance always
> seems to be created inside "Http" or one of its implementing classes, which
> forces resolution to a single IP address.
>
> After reading "Connection-Level Client-Side API: Stand-Alone HTTP Layer
> Usage", it appears that I might be able to combine the HTTP layer with a
> TCP connection I've pre-created and a manually specified TLS stage. Are
> there any examples that might give me a better idea how to achieve this, or
> is "_outgoingConnection" in "Http.scala" probably the best place to start?
>

That is definitely possible, and yes, that method is where to look for
example (for now at least). You will see that the graph looks like this:

[transportFlow] <-> [tlsStage] <-> [clientLayer] <->

The transportFlow is of type Flow and tlsStage, clientLayer are BidiStages.
Together, these will form a Flow[HttpRequest, HttpResponse]

You can reuse these elements, and even use a different transport than TCP
to serve HTTP.

-Endre


>
> Alternately, is there some other approach that I'm overlooking?
>
> Thanks,
>
> Tim
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Akka Team
Typesafe - Reactive apps on the JVM
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to