Hello Lagom Developers and Akka Experts
I want to call external services over Http from my Lagom Application.
I am struggling to find a right way to do this.
I tried few solutions and not really satisfied and need your suggestions.
-
I started to use play WSClient which is available by default in Lagom(1.6.4) and I could inject it in my Class. I read the documentation here Java WS - 2.8.x
I did not like the way to configure the http proxy as mentioned here Java WS - 2.8.x
What if I want to setup separate proxy for each http service? -
I started to check google and landed on this page java - What is the simplest way to consume an external REST service in Lagom? - Stack Overflow.
I created another maven module, Defined service descriptor for external service, bindClient in my other module where I want to call the service. But where to define to proxy server settings, base url, TimeOut for the external service is still not clear. Anyway, I just wanted to try and started the lagom app in IntelliJ(Dev mode) and got error that serviceName=[ex-service] was not found. Hint: Maybe it was not started? Someone says to use --external-service with lightbend orchestration and someone mentioned to use and also mentioned not to use it in PROD. It’s really not clear how to do such a basic thing. -
Then I found that I have option to use akk-http. I haven’t tried to use so really cannot say about the pros and cons of using this directly.
-
Last option for me to use is OkHttpClient which is also non blocking and also supported by Kamon monitoring.
Please help me here. Which approach should I take?