I've a microservice built in scala talking to gremlin-server (single host) via gremlin-driver. I am using titan11 branch. The gremlin-server is behind a nginx proxy.
My service is running fine immediately after launch. But after say 1 minute, the service starts to fail with
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.nio.channels.ClosedChannelException
ms-app-consumer | at org.apache.tinkerpop.gremlin.driver.Client.submit(Client.java:146)
ms-app-consumer | at in.nixinn.services.Service$class.fetchConsumer(ConsumerMicroService.scala:660)
ms-app-consumer | at in.nixinn.services.ConsumerMicroService$.fetchConsumer(ConsumerMicroService.scala:710)
....
....
java.nio.channels.ClosedChannelException: null
ms-app-consumer | at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:44
1)
ms-app-consumer | at akka.stream.impl.fusing.GraphInterpreterShell.receive(ActorGraphInterpreter.scala:396
....
....
ms-app-consumer | Caused by: java.util.concurrent.ExecutionException: java.nio.channels.ClosedChannelException
ms-app-consumer | at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
ms-app-consumer | at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
ms-app-consumer | at org.apache.tinkerpop.gremlin.driver.Client.submit(Client.java:144)
ms-app-consumer | ... 65 more
ms-app-consumer | Caused by: java.nio.channels.ClosedChannelException
When I increased the proxy_read_timeout on nginx, the issue is not occurring. Hence, I believe the websocket channel is being closed by nginx (nginx has a default value for the proxy_read_timeout as 60 seconds, which I now changed for the time being to 86400s). I was trying to figure out how and where I can configure heartbeat for the connections from gremlin-driver. Kindly help me with this.
Thanks and Regards,
Phani