Micronaut Docker issue with httpClient

78 views Asked by At

Facing issues with read timeout and slow HTTP responses when running my Micronaut application as a docker Container. The application is hitting another rest API using HTTPClient ( tried both Declarative or Low Level). The same application works without issues when run outside of Docker. Tried running the application as Docker in local and servers.

Micronaut version :4.1.6

Java :17

Tried both openjdk:17-jdk-slim & openjdk:17-alpine for the base image. I am using Jib to build the image.

1

There are 1 answers

0
Syed Sheheryar Umair On

Can you share the error of your docker logs here, please. I was getting same error of time-out and I resolved this using these line of code

micronaut.http.client.my-client.connect-timeout=5s
micronaut.http.client.my-client.read-timeout=20s